Showing posts with label pdf. Show all posts
Showing posts with label pdf. Show all posts

Wednesday, March 28, 2012

RSException on Matrix report rendering to PDF

I'm receiving the following exception (+stack trace) when trying to
render to PDF, but it works fine when rendering to all other formats.
Ideas?
~Lance
-- Error/Stack trace--
System.Web.Services.Protocols.SoapException:
System.Web.Services.Protocols.SoapException: Exception of type
Microsoft.ReportingServices.ReportRendering.ReportRenderingException
was thrown. -->
Microsoft.ReportingServices.Diagnostics.Utilities.RSException:
Exception of type
Microsoft.ReportingServices.ReportRendering.ReportRenderingException
was thrown. -->
Microsoft.ReportingServices.ReportProcessing.WrapperReportRenderingException:
Exception of type
Microsoft.ReportingServices.ReportRendering.ReportRenderingException
was thrown. -->
Microsoft.ReportingServices.ReportRendering.ReportRenderingException:
Exception of type
Microsoft.ReportingServices.ReportRendering.ReportRenderingException
was thrown. --> System.NullReferenceException: Object reference not
set to an instance of an object.
at
Microsoft.ReportingServices.Rendering.ImageRenderer.Matrix.FindHeaderRowsForVerticalResize(Int32
headerRowRow, Int32 level, Int32 lastRowForLevel, Int32& startRow,
Int32& endRow, Double& startTop)
at
Microsoft.ReportingServices.Rendering.ImageRenderer.Matrix.ResizeCellsVertically(ReAdjustments&
itemReAdjustment)
at
Microsoft.ReportingServices.Rendering.ImageRenderer.Matrix.CalculateItemMeasurement(Orientation
orientation, Double childrenMaximumDistance, ReAdjustments
itemReAdjustment, ItemContext savedContext)
at
Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation
orientation, Boolean repeatableParent, Boolean canDelete, Double&
minimumCoordinate, Double& distance)
at
Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation
orientation, Boolean repeatableParent, Boolean canDelete, Double&
minimumCoordinate, Double& distance)
at
Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.CalculatePage(Orientation
orientation, Boolean repeatableParent, Boolean canDelete, Double&
minimumCoordinate, Double& distance)
at
Microsoft.ReportingServices.Rendering.ImageRenderer.ImageRendererBase.ProcessPages(CompositionBase
theComposition, Report theReport, Boolean needTotalPages, Int32
startPage, Int32 endPage, Boolean render)
at
Microsoft.ReportingServices.Rendering.ImageRenderer.PdfReport.RenderReport(Report
report, NameValueCollection deviceInfo, EvaluateHeaderFooterExpressions
evaluateHeaderFooterExpressions, CreateAndRegisterStream
createAndRegisterStreamCallback)
at
Microsoft.ReportingServices.Rendering.ImageRenderer.ImageRendererBase.Render(Report
report, NameValueCollection reportServerParameters, NameValueCollection
deviceInfo, NameValueCollection clientCapabilities,
EvaluateHeaderFooterExpressions evaluateHeaderFooterExpressions,
CreateAndRegisterStream createAndRegisterStream)
-- End of inner exception stack trace --
at
Microsoft.ReportingServices.Rendering.ImageRenderer.ImageRendererBase.Render(Report
report, NameValueCollection reportServerParameters, NameValueCollection
deviceInfo, NameValueCollection clientCapabilities,
EvaluateHeaderFooterExpressions evaluateHeaderFooterExpressions,
CreateAndRegisterStream createAndRegisterStream)
at
Microsoft.ReportingServices.ReportProcessing.ReportProcessing.a(DateTime
A_0, GetReportChunk A_1, ProcessingContext A_2, RenderingContext A_3,
CreateReportChunk A_4, Boolean& A_5)
-- End of inner exception stack trace --
at
Microsoft.ReportingServices.ReportProcessing.ReportProcessing.a(DateTime
A_0, GetReportChunk A_1, ProcessingContext A_2, RenderingContext A_3,
CreateReportChunk A_4, Boolean& A_5)
at
Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RenderReport(DateTime
executionTimeStamp, GetReportChunk getCompiledDefinitionCallback,
ProcessingContext pc, RenderingContext rc)
at
Microsoft.ReportingServices.Library.RSService.RenderAsLive(CatalogItemContext
reportContext, ItemProperties properties, ParameterInfoCollection
effectiveParameters, Guid reportId, ClientRequest session, String
description, ReportSnapshot intermediateSnapshot,
DataSourceInfoCollection thisReportDataSources, Boolean
cachingRequested, Warning[]& warnings, ReportSnapshot&
resultSnapshotData, DateTime& executionDateTime,
RuntimeDataSourceInfoCollection& alldataSources, UserProfileState&
usedUserProfile)
at
Microsoft.ReportingServices.Library.RSService.RenderAsLiveOrSnapshot(CatalogItemContext
reportContext, ClientRequest session, Warning[]& warnings,
ParameterInfoCollection& effectiveParameters)
at
Microsoft.ReportingServices.Library.RSService.RenderFirst(CatalogItemContext
reportContext, ClientRequest session, Warning[]& warnings,
ParameterInfoCollection& effectiveParameters, String[]&
secondaryStreamNames)
at
Microsoft.ReportingServices.Library.RenderFirstCancelableStep.Execute()
at
Microsoft.ReportingServices.Diagnostics.CancelablePhaseBase.ExecuteWrapper()
-- End of inner exception stack trace --
at
Microsoft.ReportingServices.Diagnostics.CancelablePhaseBase.ExecuteWrapper()
at
Microsoft.ReportingServices.Library.RenderFirstCancelableStep.RenderFirst(RSService
rs, CatalogItemContext reportContext, ClientRequest session,
JobTypeEnum type, Warning[]& warnings, ParameterInfoCollection&
effectiveParameters, String[]& secondaryStreamNames)
at
Microsoft.ReportingServices.WebServer.ReportingService.Render(String
Report, String Format, String HistoryID, String DeviceInfo,
ParameterValue[] Parameters, DataSourceCredentials[] Credentials,
String ShowHideToggle, Byte[]& Result, String& Encoding, String&
MimeType, ParameterValue[]& ParametersUsed, Warning[]& Warnings,
String[]& StreamIds)
-- End of inner exception stack trace --
at
Microsoft.ReportingServices.WebServer.ReportingService.Render(String
Report, String Format, String HistoryID, String DeviceInfo,
ParameterValue[] Parameters, DataSourceCredentials[] Credentials,
String ShowHideToggle, Byte[]& Result, String& Encoding, String&
MimeType, ParameterValue[]& ParametersUsed, Warning[]& Warnings,
String[]& StreamIds)
at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean
asyncCall)
at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)Anybody have an idea/suggestion?

Tuesday, March 20, 2012

rs:SessionID= does not work

I want to render a PDF report and view the copy of the report in the HTML
viewer. What I did is to use rs.Render(...) to get the PDF report and the
SessionID, and then pass the SessionID to the URL string and run the URL.
But the rs:SessionID=xxxxx command does not work, it alway create a new
session for the report.
This part of the code works fine to generate a PDF file for me and save a
session id in m_SessionID:
byte[] results = null;
string historyID = null;
string devInfo = @."<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";
SessionHeader sh = new SessionHeader();
rs.SessionHeaderValue = sh;
results = rs.Render(
this.ReportConfig.ReportName,
"PDF",
historyID,
devInfo,
parameters,
credentials,
showHideToggle, out encoding, out mimeType, out
reportHistoryParameters,
out warnings,
out streamIDs);
m_SessionID = rs.SessionHeaderValue.SessionId;
But when I use the generated sesionid for the URL access like this:
url = "http://guoxp.softbrandsamer.com/reportserver?%2fInvItmb&rs:Command=Render&r
s:SessionID=" + m_SessionID
it will create a new instance. And when I looked at the SessionData table in
the ReportServerTempDB, a new session is created.
How to make it work? Please help. Thanks,
LianghongDid you ever find a work around for this. It doesn't seem to be working for
me either.
"Guo, Lianghong" wrote:
> I want to render a PDF report and view the copy of the report in the HTML
> viewer. What I did is to use rs.Render(...) to get the PDF report and the
> SessionID, and then pass the SessionID to the URL string and run the URL.
> But the rs:SessionID=xxxxx command does not work, it alway create a new
> session for the report.
> This part of the code works fine to generate a PDF file for me and save a
> session id in m_SessionID:
> byte[] results = null;
> string historyID = null;
> string devInfo = @."<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";
> SessionHeader sh = new SessionHeader();
> rs.SessionHeaderValue = sh;
> results = rs.Render(
> this.ReportConfig.ReportName,
> "PDF",
> historyID,
> devInfo,
> parameters,
> credentials,
> showHideToggle, out encoding, out mimeType, out
> reportHistoryParameters,
> out warnings,
> out streamIDs);
> m_SessionID = rs.SessionHeaderValue.SessionId;
> But when I use the generated sesionid for the URL access like this:
> url => "http://guoxp.softbrandsamer.com/reportserver?%2fInvItmb&rs:Command=Render&r
> s:SessionID=" + m_SessionID
> it will create a new instance. And when I looked at the SessionData table in
> the ReportServerTempDB, a new session is created.
> How to make it work? Please help. Thanks,
> Lianghong
>
>|||Hi
I've the same problem with the session an rs:SessionId, anyone knwo a
solution'
Thanks
"debra doty" wrote:
> Did you ever find a work around for this. It doesn't seem to be working for
> me either.
> "Guo, Lianghong" wrote:
> > I want to render a PDF report and view the copy of the report in the HTML
> > viewer. What I did is to use rs.Render(...) to get the PDF report and the
> > SessionID, and then pass the SessionID to the URL string and run the URL.
> > But the rs:SessionID=xxxxx command does not work, it alway create a new
> > session for the report.
> >
> > This part of the code works fine to generate a PDF file for me and save a
> > session id in m_SessionID:
> >
> > byte[] results = null;
> > string historyID = null;
> > string devInfo = @."<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";
> >
> > SessionHeader sh = new SessionHeader();
> > rs.SessionHeaderValue = sh;
> > results = rs.Render(
> > this.ReportConfig.ReportName,
> > "PDF",
> > historyID,
> > devInfo,
> > parameters,
> > credentials,
> > showHideToggle, out encoding, out mimeType, out
> > reportHistoryParameters,
> > out warnings,
> > out streamIDs);
> > m_SessionID = rs.SessionHeaderValue.SessionId;
> >
> > But when I use the generated sesionid for the URL access like this:
> > url => > "http://guoxp.softbrandsamer.com/reportserver?%2fInvItmb&rs:Command=Render&r
> > s:SessionID=" + m_SessionID
> >
> > it will create a new instance. And when I looked at the SessionData table in
> > the ReportServerTempDB, a new session is created.
> >
> > How to make it work? Please help. Thanks,
> >
> > Lianghong
> >
> >
> >

RS.EXE SCRIPT TU AUTOMATE REPORT EXECUTION

Hi,
I am searchig RSS script for RS.EXE to automate excution/run of reports.
I would like to be able to generate reports both in PDF and Excel and store
them in a predefined Server Folder.
There is 2 RSS samples even in SP1 and none of them is doing such job.
I think it could be useful to a lot of people.
Many ThanksJean-Marc,
If you want to automate report deliviery, you don't have to use rs.exe. In
report manager, check out data-driven subscriptions.
Jon Jahren
"Jean-Marc PUGIN" <jmpugin@.mobileworkers.com> wrote in message
news:OTmF9jIyEHA.824@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I am searchig RSS script for RS.EXE to automate excution/run of reports.
> I would like to be able to generate reports both in PDF and Excel and
store
> them in a predefined Server Folder.
> There is 2 RSS samples even in SP1 and none of them is doing such job.
> I think it could be useful to a lot of people.
> Many Thanks
>|||Jon,
I know this Reporting Services features.
BUT, I have to do it in automatically in our company Product independently
of any Reporting Services User Interface.
Best Regards.
"Jon Jahren" <jon.jahren.fightspam@.sqlkompetanse.no> wrote in message
news:%23CzFczJyEHA.3120@.TK2MSFTNGP12.phx.gbl...
> Jean-Marc,
> If you want to automate report deliviery, you don't have to use rs.exe. In
> report manager, check out data-driven subscriptions.
> Jon Jahren
> "Jean-Marc PUGIN" <jmpugin@.mobileworkers.com> wrote in message
> news:OTmF9jIyEHA.824@.TK2MSFTNGP11.phx.gbl...
> > Hi,
> >
> > I am searchig RSS script for RS.EXE to automate excution/run of reports.
> >
> > I would like to be able to generate reports both in PDF and Excel and
> store
> > them in a predefined Server Folder.
> >
> > There is 2 RSS samples even in SP1 and none of them is doing such job.
> >
> > I think it could be useful to a lot of people.
> >
> > Many Thanks
> >
> >
>|||Have you checked out web services. It would surprise me if that didn't have
the capability to do what you are talking about. Use web services to setup
the data driven subscriptions. I think you still want to do that, why
reinvent the wheel.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Jean-Marc PUGIN" <jmpugin@.mobileworkers.com> wrote in message
news:uGtWbTLyEHA.1396@.tk2msftngp13.phx.gbl...
> Jon,
> I know this Reporting Services features.
> BUT, I have to do it in automatically in our company Product
> independently
> of any Reporting Services User Interface.
> Best Regards.
> "Jon Jahren" <jon.jahren.fightspam@.sqlkompetanse.no> wrote in message
> news:%23CzFczJyEHA.3120@.TK2MSFTNGP12.phx.gbl...
>> Jean-Marc,
>> If you want to automate report deliviery, you don't have to use rs.exe.
>> In
>> report manager, check out data-driven subscriptions.
>> Jon Jahren
>> "Jean-Marc PUGIN" <jmpugin@.mobileworkers.com> wrote in message
>> news:OTmF9jIyEHA.824@.TK2MSFTNGP11.phx.gbl...
>> > Hi,
>> >
>> > I am searchig RSS script for RS.EXE to automate excution/run of
>> > reports.
>> >
>> > I would like to be able to generate reports both in PDF and Excel and
>> store
>> > them in a predefined Server Folder.
>> >
>> > There is 2 RSS samples even in SP1 and none of them is doing such job.
>> >
>> > I think it could be useful to a lot of people.
>> >
>> > Many Thanks
>> >
>> >
>>
>

Monday, March 12, 2012

RS Web Service to programmatically render reports

Hello, when I call the render method of a ReportService() object with the
following...
data = rs.Render("/OnlineInvoice", "PDF", Nothing, Nothing, paramaters,
Nothing, Nothing, encoding, mimeType, parametersUsed, warnings, streamIds)
with the argument paramaters being...
Dim paramaters(2) As ParameterValue
paramaters(0) = New ParameterValue
paramaters(0).Name = "P_ClientID"
paramaters(0).Value = 815
paramaters(1) = New ParameterValue
paramaters(1).Name = "P_InvoiceID"
paramaters(1).Value = 22230
I get the error...
System.Web.Services.Protocols.SoapException: The value of parameter
'Parameters' is not valid. Check the documentation for information about
valid values. --> The value of parameter 'Parameters' is not valid.
Any Ideas? thank you for the help!
--See if you need to use 1 instead of 2 in array declaration:
Dim paramaters(1) As ParameterValue
--
Dmitry Vasilevsky, SQL Server Reporting Services Developer
This posting is provided "AS IS" with no warranties, and confers no rights.
--
---
"Richard Cranium" <mgreco40@.hotmail.com> wrote in message
news:edWp1rjoEHA.1712@.tk2msftngp13.phx.gbl...
> Hello, when I call the render method of a ReportService() object with the
> following...
> data = rs.Render("/OnlineInvoice", "PDF", Nothing, Nothing, paramaters,
> Nothing, Nothing, encoding, mimeType, parametersUsed, warnings, streamIds)
> with the argument paramaters being...
> Dim paramaters(2) As ParameterValue
> paramaters(0) = New ParameterValue
> paramaters(0).Name = "P_ClientID"
> paramaters(0).Value = 815
> paramaters(1) = New ParameterValue
> paramaters(1).Name = "P_InvoiceID"
> paramaters(1).Value = 22230
> I get the error...
> System.Web.Services.Protocols.SoapException: The value of parameter
> 'Parameters' is not valid. Check the documentation for information about
> valid values. --> The value of parameter 'Parameters' is not valid.
> Any Ideas? thank you for the help!
>
>
> --
>
>

Tuesday, February 21, 2012

RS 2005, VS 2005 and specifying printer trays

I am trying to build a demo to prove the following can be done with SQL 2005 Reporting Services:

1. Export report as .pdf to file location. - Done

2. Use CSLA business objects with Reporting Services to reuse the object's ability to populate itself. - Done

3. Set certain reports to print from certain trays on a specific printer. More specifically, for a certain report, I need the first page to print from Tray 1 and all remaining pages to print from Tray 2.

This is the task I am having problems with. I am trying to just get the tray selection working now with just a windows app but even if I get that far, will I need to extend RS and write my own print routine? Also, if this report is served to the client via URL, will I be able to specify the printer and tray or will I need a print server to handle this?

Thanks.

I have had luck with using ABCPDF for PDF manipulation.

http://www.websupergoo.com/

You could create two separate printers with different default trays and then print the first page to one printer, and the rest to another.

Bryan has a good article on printing from Reporting Services:
http://blogs.msdn.com/bryanke/articles/71491.aspx|||Unfortunately, this solution does not work for me. I am printing Optical Recognition Marks on the pages as they are printed so they need to come off the same printer so they are in the proper order to go into the feeder.

RS 2005, VS 2005 and specifying printer trays

I am trying to build a demo to prove the following can be done with SQL 2005 Reporting Services:

1. Export report as .pdf to file location. - Done

2. Use CSLA business objects with Reporting Services to reuse the object's ability to populate itself. - Done

3. Set certain reports to print from certain trays on a specific printer. More specifically, for a certain report, I need the first page to print from Tray 1 and all remaining pages to print from Tray 2.

This is the task I am having problems with. I am trying to just get the tray selection working now with just a windows app but even if I get that far, will I need to extend RS and write my own print routine? Also, if this report is served to the client via URL, will I be able to specify the printer and tray or will I need a print server to handle this?

Thanks.

I have had luck with using ABCPDF for PDF manipulation.

http://www.websupergoo.com/

You could create two separate printers with different default trays and then print the first page to one printer, and the rest to another.

Bryan has a good article on printing from Reporting Services:
http://blogs.msdn.com/bryanke/articles/71491.aspx|||Unfortunately, this solution does not work for me. I am printing Optical Recognition Marks on the pages as they are printed so they need to come off the same printer so they are in the proper order to go into the feeder.