SQL 2000 Reporting Services-Printing Error

Apr 12, 2007

One of the users is trying to print a report, in SQL RS 2000, He gets the foll err:



Error Loading resource String. (0*000000000)



He has a Windows 2000 professional version.



Any idea on how to fix this err? For the other users it works just fine.

View 1 Replies


ADVERTISEMENT

Reporting Services 2000 - Printing Hangs

Jan 8, 2007

I am running SQL 2000 SP4 with Reporting Services 2000 SP2. Reporting services hangs when I try to print reports. The reports render okay, and when I click on the print icon, I get the appropriate dialog box. Once I click "OK", I get the "Printing..." dialog that says "Printing Now...", but it never prints, and the window eventually stops responding. As far as I am aware, no changes have been made to the server, and it was working fine approximately 10 days ago. Below is the contents of my RS Client Print Log (%Temp%LOG56.tmp):
CRSClientPrint::Print - Starting Function.
reportServerUrl = http://reportsrv/ReportServer
reportPath = %2fEngineering%2fRamz+-+Development%2fDEV_Reports%2fContract_Project_By_State&ContractStateDesc=Active
reportName = Contract_Project_By_State
CResourceManager::SetLocaleInfo - Starting Function.
SetUICulture - Starting Function.
Attempted UI LCID = 9
Using UI LCID = 1033
SetUICulture - Ending Function.
CResourceManager::LoadResourceDLL - Starting Function.
CResourceManager::LoadResourceDLL - Ending Function: 0x00000000.
CResourceManager::CanUseCurrentLocale - Starting Function.
CResourceManager::CanUseCurrentLocale - Ending Function.
CResourceManager::LoadGDIPlus - Starting Function.
CResourceManager::LoadGDIPlus - Ending Function: 0x00000000.
Attempted culture = 1033
Using culture = 1033
Culture name = English_United States.1252
CResourceManager::SetLocaleInfo - Ending Function: 0x00000000.
CPrintDlg::Print - Starting Function.
CPrintDlg::InitializePrintDlg - Starting Function.
CPrintDlg::GetDefaultPrinterName - Starting Function.
CPrintDlg::GetDefaultPrinterName - Ending Function: 0x00000000.
CPrintDlg::SetPrinterPaperSize - Starting Function.
CPrintDlg::SetPrinterPaperSize - Ending Function: 0x00000000.
CPrintDlg::InitializePrintDlg - Ending Function: 0x00000000.
CReport::SetReportName - Starting Function.
CReport::SetReportName - Ending Function: 0x00000000.
CPrintDlg::PrintReportPages - Starting Function.
CCancelDlg::StartDialog - Starting Function.
CCancelDlg::StartDialog - Ending Function: 0x00000000.
CReport::Fetch - Starting Function.
CReport::ComparePrintInfo - Starting Function.
Value of diff = 2
CReport::ComparePrintInfo - Ending Function.
CReport::ClearPages - Starting Function.
CReport::ClearFetchedPages - Starting Function.
CReport::ClearFetchedPages - Ending Function.
CReport::ClearPages - Ending Function.
CReport::ResetNextFetch - Starting Function.
Next Fetch set to 1
CReport::ResetNextFetch - Ending Function.
CReport::StartFetchThread - Starting Function.
CReport::GetPageToFetch - Starting Function.
Page to fetch = 1
CReport::GetPageToFetch - Ending Function.
CReport::StartFetchThread - Ending Function: 0x00000000.
CReport::Fetch - Ending Function: 0x00000000.
CReport::GetPage - Starting Function.
Page = 1
CReport::GetPageWrapper - Starting Function.
Page wrapper = 0x00000000
CReport::GetPageWrapper - Ending Function.
CReport::FetchThreadMain - Starting Function.
CReport::GetPageToFetch - Starting Function.
Page to fetch = 1
CReport::GetPageToFetch - Ending Function.
CReport::FetchAllPages - Starting Function.
CReport::PerformFetch - Starting Function.
CReport::GetPaperSize - Starting Function.
Height = 8500, Width = 11000 IsMM = 0
CReport::GetPaperSize - Ending Function.
CResourceManager::SetInvariantCulture - Starting Function.
CResourceManager::SetInvariantCulture - Ending Function: 0x00000000.
CResourceManager::ResetCulture - Starting Function.
CResourceManager::ResetCulture - Ending Function: 0x00000000.
Url = http://reportsrv/ReportServer?%2fEngineering%2fRamz+-+Development%2fDEV_Reports%2fContract_Project_By_State&ContractStateDesc=Active&rs:Command=Render&rs:format=IMAGE&rc:OutputFormat=emf&rc:StartPage=1&rc:EndPage=65535&rc:PageWidth=11.0in&rc:PageHeight=8.500in&rc:MarginTop=6.350mm&rc:MarginBottom=6.350mm&rc:MarginLeft=6.350mm&rc:MarginRight=6.350mm&rs:PersistStreams=True


Can anyone give me any ideas as to how to troubleshoot this issue?

View 3 Replies View Related

I Am Getting An Error Message When I Try To Print Using Reporting Services: An Error Occurred During Printing (0x80004005)

May 22, 2007

I am getting an error message when I try to print using reporting services: "an error occurred during printing (0x80004005)"

View 4 Replies View Related

Printing In Reporting Services Hangs

Jul 3, 2007

Please Help!!!

We have never been able to get the printing to work on any of our reports using SQL Server Reporting Services 2005 SP2 in our production environment. Without this feature of printing a report, we cannot go live with SSRS at all.

We have tried adding the SP2 after a clean install on a new server -- yet we still have this problem.

I read a few some posts about uninstall the old ActiveX control used for printing, so I did this and installed the new
one but that didn't help either.

We can print to files without issue - only when we try to print to a real printer does it hang forever.

It doesn't matter how big the report is, 100 pages or 1/4 of a page, same problem.

We do the following:

1) Run the report
2) Click the print button
3) Select a printer and press ok
4) "Printing Now..." dialog box appears
5) "Print Error" dialog appears and never goes away - and nothing is printed out.
Have to close IE and crash the report session to get out of it.

This is the result on every client computer we have ever used in trying to access
the report server.

It also hangs in running a Print Preview for all reports.

We are printing to network printers from IE6 and IE7.

Since this is on a server, we do not have a local printer to this server computer to try to print to.
Even if it worked on a local printer, this is supposed to be an enterprise solution.
Almost all of our employees print to network printers.

I am logged into my machine as a domain admin. I have no printing problems
in any program printing to any printer, except when using Reporting Services.

We are trying to print from an ASP web application which runs the reports in an iframe using URL access.

We are able to print the same reports on all of our development environments using the same ASP web application and RDL.

Again, Please help!!!

View 30 Replies View Related

Duplex Printing In Reporting Services

Sep 13, 2007

I have been working on this problem for days. I have a report that is grouped
and will be printed duplex (front and back). There is a page break after each
group. I want to ensure that the start of a new group does not end up printed
on the back side of an old group. For example:



Page 1 (printed on front side of paper): group 1
Page 2 (printed on back side of paper): more group 1
Page 3 (printed on front side of paper): more group 1
Page 4 (printed on on back side of paper): group 2 <--- This is a problem


I need:



Page 1 (front side): group 1
Page 2 (back side): more group 1
Page 3 (front side): more group 1
Page 4 (back side): <This Page Intentionally Left Blank>
Page 5 (front side): group 2


Issues that I've run into include the fact that SSRS renders the entire body
first, before rendering the header/footer. This prevents the body of the
report from knowing which page it will end up on when it is rendered (and is
also why you cannot reference Globals!PageNumber from the body).


The restriction above also prevents using a variable in custom code to know
when to generate a page break. If you set this variable in the header/footer
then the body will never see it as the entire body is rendered first and will
therefore only see the initial state of the variable.


I have seen this issue posted in a number of places,
but no one ever has a solution to this (except switching back to
Crystal Reports). Have any MVPs ever addressed this issue? I am
really hoping someone can offer a good solution or work-around.



View 7 Replies View Related

Landscape Printing Issue In SQL Reporting Services

Jan 23, 2007

I have reports, set to print on Landscape and Legal ie 14 * 8.5. However, when certain users try to print the report, it prints it in Letter, even though the report is set to print in legal /landscape.

The strange part is that for most users it prints correctly in legal, only for some it is on letter. Any idea why this would happen?

View 4 Replies View Related

Printing And Exporting In Reporting Services 2005

Feb 13, 2007

I want to be able to grant the ability to print and export reports in Report Manager to individual users or a group of users. I know I can disable or enable printing and exporting for all users. What I would like to do is create user groups and place everyone who needs to ability to print or export into those groups.

View 1 Replies View Related

Reprting Services 2000 Printing

Aug 29, 2006

Hi,
I am using Reporting services 2000 in asp.net application.Everything is working fine ,but when I am trying to get a print using Internet Explorer Printing options ,the toolbar of the report is also coming into the print preview.I want to get rid of it.I want only the report no toolbar.
Can anybody help me?
Thanks!!

View 1 Replies View Related

SQL Reporting Services 2005: Sizing Report For Printing

Feb 1, 2008

I have a report that is a little wide, and when I export it to an Excel file it spans about 2 pages. I have it set to an 8.5 height and 11 width for printing in landscape on normal-sized paper. But is there a way to make sure that the report exports with the printing page break covering the entire width so that the report prints only one page across? The users don't want to resize in Excel before printing.

View 3 Replies View Related

Reporting Services :: Printing Reports On Separate Pages

May 18, 2015

I must confess it has been a long time since I have done any SSRS reporting.  I have the following SQL Statement (I will change it to a stored Procedure with parameters once I get the design done):

SELECT
rc.wo_id,
rc.process_id,
rc.item_id,
rc.lot_no AS full_lot_no,
rc.oper_id, rc.seq_no,
CAST(la.attr_value AS DECIMAL(12, 2)) AS weight,

[Code] ....

This gives me the data I want which looks like this:

Rework ID              Ingot           Oper ID        Piece         Rework
28                          xxxxxx14           5                   M88           Route 1
55                         xxxxxxx15           5                   B106          Route 2
79                         xxxxxxx19           5                    M68            Route 3
164                       xxxxxx234           5                    T16             Route 4
                            xxxxxx234           5                     B82             Route 4

The grouping is on the Rework ID.  Any of the pieces can be put on any rework route.  As you can see, there are 4 routes, but 5 pieces.  What I need is for each rework ID to be printed on its own paper even if there is only 1 record for the route.  So I would expect 4 pieces of paper, 3 with 1 record, the 4th with two pieces.  Is there a setting in the Tablix or report that I can set, or is there an expression I can use?

View 2 Replies View Related

Reporting Services :: SSRS Printing - Need To Install ActiveX

Aug 24, 2015

We have SSRS reports hosted on a terminal server. When user clicks PRINT button, there is a prompt "Printing is not available. Verify that ActiveX is enabled,..." When logs on as Admin, we can install this ActiveX, however normal users won't have the privilege.

View 8 Replies View Related

Problem Printing Local Report In Sql Reporting Services

Oct 5, 2006

I have a local report for which i am binding the Dataset dynamically. I am trying to print this report using a seperate button on the page. I saw in the forums saying that the reportviewer can be converted to an EMF file, bind this to an image control and can Print this image using Javascript.

Can anyone help me with the sample code to print local report from the reportviewer (it may be in any approach.)

Thanks in advance.Sekhar T

View 9 Replies View Related

Reporting Services :: Printing Reports With Microsoft Edge

Aug 3, 2015

I can't print reports using Microsoft Edge from Windows 10 With IE 11 Works fine.I've tried regsvr32 with rsclientprint64.dll but it's not working.

View 8 Replies View Related

Reporting Services :: Printing Table Hidden Based On Expression

Nov 4, 2015

I have an RDL report that has tables which are hidden based on expression. When I chose Run, they are appropriately hidden or visible. However, when I chose print, all tables are printed, even if they are invisible in the run version. 

View 14 Replies View Related

Report Printing In Landscape From SQL Reporting Services Designer Or Browser

Jan 16, 2007

Hello,

I am trying to print a report in landscape mode from VS 2003 from designer preview or at run time. The users don't want to change a mode manually. I tried to make width 11 or 11.5 in and height 8.5in with zero margins and 0.5in (tried a lot of combinations) - doesn't work! still printing in portrait. Please help! Thank you

View 7 Replies View Related

PDF Export Error In Reporting Services 2000

Mar 23, 2006





Hi,

I am exporting my report in PDF format and i am getting following error:-





Exception of type Microsoft.ReportingServices.ReportRendering.ReportRenderingException was thrown. (rrRenderingError) Get Online Help



Exception of type Microsoft.ReportingServices.ReportRendering.ReportRenderingException was thrown.



Font 'Arial' doesn't support style 'Regular'.



I am using sql server2000 reporting services....

can anyone help !



thanks



View 2 Replies View Related

Getting Following Error While Installing Sql Server 2000 Reporting Services Set Up.

Mar 30, 2007

Dear All,
 I am making web application using Asp.net C#(Visual Studio2005). And Sql server 2000 as a back End upgraded with service pack 3 and analysis service.
Now I am trying to install sql server 2000 report services. But I run SQL2KRSSP1-ENG.EXE setup Then following error occurs
The upgrade patch can not be installed by window installer because the program to be upgraded may be missing , or the upgrade patch may update a different version of the program Verify that the program to be upgraded exists on your computer and that you have the correct upgrade patch.
I redownload the same exe to other location. And again run but getting same error
Please Guide me or atleast give some help full link.
thanks

View 1 Replies View Related

Migrate From 32bit 2000 Reporting Services To 2005 64bit Reporting Services

Mar 22, 2008



Hello,

I am trying to migrate my reports from SQL server 2000 reporting services 32bit to 2005 64bit. I am following the migration steps that MS specified.
Restored my Reportserver and ReportserverTempDB databases
Then I was using the configure Report services to upgrade these databases but I always end up getting the follwoing exception when I run the upgrade on the "Database Setup" configuration for 'ReportServerTempDB' database
System.Data.SqlClient.SqlException: Could not locate entry in sysdatabases for database 'ReportServerTempDBTempDB'. No entry found with that name. Make sure that the name is entered correctly.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.ReportingServices.Common.DBUtils.ApplyScript(String connectionString, String script)
at ReportServicesConfigUI.SqlClientTools.SqlTools.ApplyScript(String connectionString, String script)

It's driving me crazy, why is it looking for 'ReportServerTempDBTempDB' in the catalog instead of 'ReportServerTempDB'?
Is it possible to migrate from 32bit to 64bit?

Any help is appreciated

View 1 Replies View Related

Compatibility Of SQL Express Reporting Services With SQL 2000 Reporting Services

Dec 6, 2006

I'm attempting to obtain a cost effective solution for my existing customers to develop reports on their SQL 2000 Server installations using their Reporting Services 2000. With products like Visual Basic.NET 2003 becoming almost impossible to obtain, I have at least one customer who is running into a dead end.

One option possibly is the SQL Express with Advanced Services download, which has Reporting Services. My questions are as follows:

Can the report designer component of SQL Express Reporting Services be configured to connect to an external database (which would happen to be a SQL 2000 database) to establish its datasets?
Does the resultant designed report end up in an RDL file? If the customer published this report via the Reporting Services 2000 Report Manager, would the report be able to run?

Sorry for asking a question like this that I could probably answer on my own, but my customer needed this answer yesterday. I have scoured the web and microsoft sites - and posted a question on the official SQL Reporting Services cateogy ... in an attempt to answer the basic question of how to design reports for Reporting Services 2000 in the absence of Visual Basic.NET 2003 (or other .NET 2003 tools) with no success.

Thanks to anyone who can help.

-- Mark

View 1 Replies View Related

Analysis Services 2000 + Reporting Services 2005 + Parameters

Sep 16, 2007



Hi All,

I'm trying to create reports in RS2005 using AS2000 as my data source. I understand that if I use RS2005 on AS2000, I wont be able to enjoy the OLAP based parameters as in using AS2005. Does anyone know an easy way to easily use Parameters in RS2005 while still using AS2000?

Regards,
Joseph

View 1 Replies View Related

Reporting Services 2005 And Analysis Services 2000

Jul 30, 2007



Hello,



i have a small problem with the data sources in the reporting services, maybe you can clarify the situation... I have a MS CRM 3 solution with the reporting services 2005 installed. From an other vendor we have a arcplan solution on the 2000 analysis services. I would like to get access from the 2005 reporting services to the 2000 cube. Is this possible? Ive read that the SSMS cant connect to the 2000 cubes. Can i connect from the reporting services??

thank you
regards
Andreas

View 3 Replies View Related

Reporting Services :: JIT Debugging Error When Reporting Configuration Manager Is Opened

Sep 11, 2015

We have installed SQL Server 2005 with reporting services.When tried to open getting errors as below: how to avoid such errors See the end of this message for details on invoking  just-in-time (JIT) debugging instead of this dialog box.

ReportServicesConfigUI.WMIProvider.WMIProviderException: A WMI error has occurred and no additional error information is available. ---> System.Runtime.InteropServices.COMException (0x8000000A)
  at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
 
[code]...

View 4 Replies View Related

Reporting Services :: SSRS 2008 R2 - HTTP Error 503 - The Services Is Unavailable

Jul 23, 2010

We built our prod server [vm] with SQL Server 2008 R2 on Server 2008 R2.  It works nicely.  Then we made a copy of the VM and renamed it (so our test environment would be IDENTICAL to production).  After that, SSRS was broken: I get "HTTP Error 503. The service is unavailable."  I can't connect via http, or SSMS.

We have tried:

* Running SSRS config tool (several times)

* Running with/without the IIS Server Role

* Dropping & recreating the SSRS keys

* Recreating the ReportServer database, etc

* Checking all of the accounts, permissions, etc

* Running SQL Repair

* Going through the registry to fix any references to the machine's old name

* Uninstalling, reinstalling SSRS

* Completely uninstalling ALL of the parts of SQL Server 2008 R2, deleting all directories, removing references to SQL Server from the registry, rebooting, reinstalling everything.

None of this has worked.  SSRS [R2] is still 503 on our test box.

the SSRS [NT] service seems to run, without error.  The Event Viewer doesn't seem to be recording any errors.  The SSRS logs say that the default URL is wrong, but we get the same error in Prod, and Prod works fine.  The other SQL Logs say something about not being able to contact the service.  However, as I said, the [NT] service seems to be working fine.

View 4 Replies View Related

SQL 2000 Reporting Services

May 28, 2004

Can report be created with code (XML, SQL, ActiveX?) using the new Reporting Services for SQL Server 2000?

I have to create a report and save it in Excel format. By default the report is saved as - *.rdl. but the web report server has an option of saving it as excel or pdf etc formats. Is there a way to do this automatically? ie by code and not manually

Please help

View 3 Replies View Related

SQL 2000 Reporting Services

Aug 23, 2007

Yes folks that's right, I said SQL 2000 RS.

I have used SQL 2005 reporting services for quite sometime and now one of our clients wants the SQL 2005 reports that I developed. There's only one catch: they only have SQL 2000.

Is there any way to deploy my reports to their server on SQL 2000?

View 8 Replies View Related

CSS &&amp; Reporting Services 2000

May 24, 2007

I have seen this done by someone else but cant seem to find how to do it...basically I have a sytle sheet which I want to use on all the Reporting Services reports, to so they all look the same....



Thanks

View 2 Replies View Related

New To SQL 2000 Reporting Services - Need Some Help

Apr 27, 2006

I am trying to get SQL 2000 reporting services up and running, and am trying to get a condensed explanation of what I need to do, and any other software I may need to purchase.

I have already installed the Reporting Services, and after reading the help, it seems that I have to install MS Visual Studio 2003 in order to design the reports. Is this true.

Anyone that can give me some help in getting this up and running - I would be grateful.



Thanks so much - Joe

View 1 Replies View Related

Reporting Services 2000

Aug 20, 2007

Could someone assist me in setting up Data Driven Subscriptions for Reporting Services 2000?

Thank you in advance.

Ken

View 1 Replies View Related

Reporting Services 2000

Mar 13, 2007

Hi

I have used Reporting Services 2000 to create a template, and works in a mail merge sort of way, creating a delivery note for each order.

The problem I have is, if an order goes over two pages.. I need a easy way to present this, so that the user knows to send two pages.... Obviously, the correct way would be to page it in some way but from what I understand, RS 2000 would page the whole documents (ie all orders) and there is no way of paging in respect to a group (ie order no)

The next option is to have cont. at the bottom of page 1 (if there are more than 1 page), does any1 know how to do this? cos of obviously on the screen it will always be 1 page???

I hope I make some sense... any help would be great....

Thanks in advance :)

View 9 Replies View Related

Reporting Services 2000

Feb 8, 2007

When i save a report as a web archive page breaking for the report is not enabled ?The entire data is displayed in a single page even if paging properties are enabled for the report.

View 1 Replies View Related

Error Programaticaly Rendering A Report Using Reporting Services Web Services

Dec 19, 2006

I'm using Reporting Services 2005 SP1 and wrote some code to render reports server-side.
My sample report has few parameters that must be passed so I pass these parameters with code.

<My code>
ReportServiceExecution.ReportExecutionService rs = new ReportServiceExecution.ReportExecutionService();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
string extension, mimeType, encoding;
ReportServiceExecution.Warning[] warnings;
string[] streamID;

ParameterValue[] parameters = new ParameterValue[2];

parameters[0] = new ParameterValue();
parameters[0].Name = "pID";
parameters[0].Value = "6548747";

parameters[1] = new ParameterValue();

parameters[1].Name = "pClass";

parameters[1].Value = "8";


ExecutionHeader header = new ExecutionHeader();
ExecutionInfo executionInfo = rs.LoadReport(reportPayslip.Name, null);
executionInfo = rs.SetExecutionParameters(parameters, "en-us");
rs.ExecutionHeaderValue = header;
rs.ExecutionHeaderValue.ExecutionID = executionInfo.ExecutionID;

byte[] report = rs.Render("PDF", "<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>", out extension, out mimeType, out encoding, out warnings, out streamID);
</My code>

Actually, I have several more parameters but I've checked the collection and all the parameters I want are there and have values. Their names match those found in executionInfo.Parameters. But when I run my code I get the following error on Render():

<Error>
"This report requires a default or user-defined value for the report parameter 'pClass'. To run or subscribe to this report, you must provide a parameter value. ---> This report requires a default or user-defined value for the report parameter 'pClass'. To run or subscribe to this report, you must provide a parameter value. ---> This report requires a default or user-defined value for the report parameter 'pClass'. To run or subscribe to this report, you must provide a parameter value."
</Error>

I've double-checked and my parameter array does have the problematic parameter, I passed it a value but when I check executionInfo.Parameters I see that it's the only parameter that hasn't been give a default value after calling SetExecutionParameters(). So my parameters do seem to be passed but one seems to refuse getting a value. If I comment out the SetExecutionParameters() line I get, as expected a similar error but on another parameter (first one in the executionInfo.Parameters collection). So I'm left to beleive that the SetExecutionParameters() has some kind of bug as it works for all but one parameter. I've checked casing, spelling, tried passing phony parameters and from what I've seen I should be getting an error when I pass the parameters if I got something wrong.

Any help would be much appreciated.

View 3 Replies View Related

Reporting Services :: Error When View Reports Or Manually Processing TFS Data Warehouse And Analysis Services Cube

Apr 24, 2015

I am trying to configure the reporting for TFS using SQL Server. But I get following error when viewing any report:

So I try to manually process the cube to check if it works. I am following this article: [URL] ....

When I click on GetProcessingStatus and invoke it (with last field set as TRUE) I get following error:

How to resolve this issue and be able to see the reports.

View 5 Replies View Related

SQL 2000 Reporting Services - Parameters

Mar 23, 2004

I am trying to figure how to programmatically pass parameters to the report in SQL Reporting Services using web service API and then send this report to the printer. I found code in C# on how to print and it does work very well. I am hoping to add report parameters to this module. Any ideas, samples or help would really be appreciated.


here is the code for printing

using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Printing;
using System.IO;
using System.Web.Services.Protocols;
using PrintReport.reportserver;
using System.Runtime.InteropServices; // For Marshal.Copy

namespace PrintReport
{
/// <summary>
/// A simple console application that demonstrates one way to
/// print Reporting Services reports to a printer.
/// </summary>
class app
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
PrintExample pe = new PrintExample();
// The name of the printer should be added here;
// this could be a local or network printer.
pe.PrintReport(@"\jacc-fs120S2500 PCL IT");
}
}

class PrintExample
{
ReportingService rs;
private byte[][] m_renderedReport;
private Graphics.EnumerateMetafileProc m_delegate = null;
private MemoryStream m_currentPageStream;
private Metafile m_metafile = null;
int m_numberOfPages;
private int m_currentPrintingPage;
private int m_lastPrintingPage;

public PrintExample()
{
// Create proxy object and authenticate
Console.WriteLine("Authenticating to the Web service...");
rs = new ReportingService();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
}

public byte[][] RenderReport(string reportPath)
{
// Private variables for rendering
string deviceInfo = null;
string format = "IMAGE";
Byte[] firstPage = null;
string encoding;
string mimeType;
Warning[] warnings = null;
ParameterValue[] reportHistoryParameters = null;
string[] streamIDs = null;
Byte[][] pages = null;

// Build device info based on the start page
deviceInfo =
String.Format(@"<DeviceInfo><OutputFormat>{0}</OutputFormat></DeviceInfo>", "emf");

//Exectute the report and get page count.
try
{
// Renders the first page of the report and returns streamIDs for
// subsequent pages
firstPage = rs.Render(
reportPath,
format,
null,
deviceInfo,
null,
null,
null,
out encoding,
out mimeType,
out reportHistoryParameters,
out warnings,
out streamIDs);

// The total number of pages of the report is 1 + the streamIDs
m_numberOfPages = streamIDs.Length + 1;
pages = new Byte[m_numberOfPages][];

// The first page was already rendered
pages[0] = firstPage;

for (int pageIndex = 1; pageIndex < m_numberOfPages; pageIndex++)
{
// Build device info based on start page
deviceInfo =
String.Format(@"<DeviceInfo><OutputFormat>{0}</OutputFormat><StartPage>{1}</StartPage></DeviceInfo>",
"emf", pageIndex+1);
pages[pageIndex] = rs.Render(
reportPath,
format,
null,
deviceInfo,
null,
null,
null,
out encoding,
out mimeType,
out reportHistoryParameters,
out warnings,
out streamIDs);
}
}

catch (SoapException ex)
{
Console.WriteLine(ex.Detail.InnerXml);
}

catch (Exception ex)
{
Console.WriteLine(ex.Message);
}

finally
{
Console.WriteLine("Number of pages: {0}", pages.Length);
}

return pages;
}


public bool PrintReport(string printerName)
{
this.RenderedReport = this.RenderReport("/SampleReports/Company Sales");
try
{
// Wait for the report to completely render.
if(m_numberOfPages < 1)
return false;
PrinterSettings printerSettings = new PrinterSettings();
printerSettings.MaximumPage = m_numberOfPages;
printerSettings.MinimumPage = 1;
printerSettings.PrintRange = PrintRange.SomePages;
printerSettings.FromPage = 1;
printerSettings.ToPage = m_numberOfPages;
printerSettings.PrinterName = printerName;
PrintDocument pd = new PrintDocument();
m_currentPrintingPage = 1;
m_lastPrintingPage = m_numberOfPages;
pd.PrinterSettings = printerSettings;

// Print report
Console.WriteLine("Printing report...");
pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);
pd.Print();
}

catch(Exception ex)
{
Console.WriteLine(ex.Message);
}
finally
{
// Clean up goes here.
}

return true;
}

private void pd_PrintPage(object sender, PrintPageEventArgs ev)
{
ev.HasMorePages = false;
if (m_currentPrintingPage <= m_lastPrintingPage && MoveToPage(m_currentPrintingPage))
{
// Draw the page
ReportDrawPage(ev.Graphics);
// If the next page is less than or equal to the last page,
// print another page.
if (++m_currentPrintingPage <= m_lastPrintingPage)
ev.HasMorePages = true;
}
}

// Method to draw the current emf memory stream
private void ReportDrawPage(Graphics g)
{
if(null == m_currentPageStream || 0 == m_currentPageStream.Length || null ==m_metafile)
return;
lock(this)
{
// Set the metafile delegate.
int width = m_metafile.Width;
int height= m_metafile.Height;
m_delegate = new Graphics.EnumerateMetafileProc(MetafileCallback);
// Draw in the rectangle
Point destPoint = new Point(0, 0);
g.EnumerateMetafile(m_metafile,destPoint , m_delegate);
// Clean up
m_delegate = null;
}
}

private bool MoveToPage(Int32 page)
{
// Check to make sure that the current page exists in
// the array list
if(null == this.RenderedReport[m_currentPrintingPage-1])
return false;
// Set current page stream equal to the rendered page
m_currentPageStream = new MemoryStream(this.RenderedReport[m_currentPrintingPage-1]);
// Set its postion to start.
m_currentPageStream.Position = 0;
// Initialize the metafile
if(null != m_metafile)
{
m_metafile.Dispose();
m_metafile = null;
}
// Load the metafile image for this page
m_metafile = new Metafile((Stream)m_currentPageStream);
return true;
}

private bool MetafileCallback(
EmfPlusRecordType recordType,
int flags,
int dataSize,
IntPtr data,
PlayRecordCallback callbackData)
{
byte[] dataArray = null;
// Dance around unmanaged code.
if (data != IntPtr.Zero)
{
// Copy the unmanaged record to a managed byte buffer
// that can be used by PlayRecord.
dataArray = new byte[dataSize];
Marshal.Copy(data, dataArray, 0, dataSize);
}
// play the record.
m_metafile.PlayRecord(recordType, flags, dataSize, dataArray);

return true;
}

public byte[][] RenderedReport
{
get
{
return m_renderedReport;
}
set
{
m_renderedReport = value;
}
}
}
}


Thanks
Tom

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved