Tuesday, March 20, 2012
ParametersUsed Always Polulated after calling ReportingService.Ren
the ParametersUsed output parameter should only be populated only if the
report being rendered is a report history snapshot. I'm invoking the Render
method with a null HistoryId as follows, so I would expect the ParametersUsed
output parameter not to get populated.
results = m_RptService.Render(m_RptCatalogItem.Path /*Report*/,
m_Format /*Format*/,
null /*HistoryID*/,
null /*DeviceInfo*/,
m_RptParameters /*Parameters*/,
null /*Credentials*/,
null /*ShowHideToggle*/,
out encoding /*Encoding*/,
out mimeType /*MimeType*/,
out historyParms /*ParametersUsed*/,
out warnings /*Warnings*/,
out streamIDs /*StreamIds*/);
The call generates the following HTTP traffic. As you can see the HistoryId
is not sent in the request yet ParametersUsed is populated in the result. If
I'm interpreting the documentation correctly this value should not be
populated in the response. I really don't what ParametersUsed to be
populated in the response. Is this the correct behavior?
POST /ReportServer/ReportService.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction:
"http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices/Render"
Content-Length: 524
Expect: 100-continue
Host: localhost
Cookie: sqlAuthCookie=****; UsrTkn=>****; AppTkn=>****
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><Render
xmlns="http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices"><Report>/ReportServerStatistics/PTest</Report><Format>HTML4.0</Format><Parameters><ParameterValue><Name>p1</Name><Value>2/11/2007
7:32:50
PM</Value></ParameterValue></Parameters></Render></soap:Body></soap:Envelope>
HTTP/1.1 200 OK
Date: Mon, 12 Feb 2007 00:32:50 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 9021
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><ServerInfoHeader
xmlns="http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices"><ReportServerVersionNumber>Microsoft
SQL Server Reporting Services Version
8.00.1038.00</ReportServerVersionNumber><ReportServerEdition>Enterprise</ReportServerEdition></ServerInfoHeader><SessionHeader
xmlns="http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices"><SessionId>glbci3rl3utt1iqmon253t45</SessionId><IsNewExecution>true</IsNewExecution><ExecutionDateTime>2007-02-11T19:32:50</ExecutionDateTime><ExpirationDateTime>2007-02-11T19:32:50</ExpirationDateTime></SessionHeader></soap:Header><soap:Body><RenderResponse
xmlns="http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices"><Result>
Base 64 Encoded response removed to shorten post
</Result><Encoding>Unicode
(UTF-8)</Encoding><MimeType>text/html</MimeType><ParametersUsed><ParameterValue><Name>p1</Name><Value>2/11/2007
7:32:50 PM</Value></ParameterValue></ParametersUsed><StreamIds
/></RenderResponse></soap:Body></soap:Envelope>Reporting Services 2005 exhibits the same behavior. The following
application produces the following output "Length: 3" indicating that the
ParametersUsed output parameter was populated even though no histryid was
provided. Is this the correct behavior? If so how do I turn it off?
According to the following documentation this does not seem like the correct
behavior (http://msdn2.microsoft.com/en-us/library/aa258532(SQL.80).aspx).
Notice that the description for ParametersUsed states that the output
parameter is only populated of a history snapshot is being rendered. This
causes fairly significant performance issues for me because in some cases I
am passing large parameters. Instead of these parameters just being in the
request, they are in both the request and the response causing the response
to be much larger than I desire.
using System;
using System.Collections.Generic;
using System.Text;
using ConsoleApplication9.rs;
namespace ConsoleApplication9
{
class Program
{
static void Main(string[] args)
{
string encoding, mimeType;
ParameterValue[] pout;
Warning[] w;
string[] s;
ReportingService rs = new ReportingService();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
ParameterValue[] pin = new ParameterValue[3];
pin[0] = new ParameterValue();
pin[0].Name = "stdt";
pin[0].Value = "2/19/2007";
pin[1] = new ParameterValue();
pin[1].Name = "enddt";
pin[1].Value = "2/20/2007";
pin[2] = new ParameterValue();
pin[2].Name = "sopco";
pin[2].Value = "A";
rs.Render("/VRU Reports/VRUAppSuccessPercent" /*Report*/,
"PDF" /*Format*/,
null /*HistoryID*/,
null /*DeviceInfo*/,
pin /*Parameters*/,
null /*Credentials*/,
null /*ShowHideToggle*/,
out encoding /*Encoding*/,
out mimeType /*MimeType*/,
out pout /*ParametersUsed*/,
out w /*Warnings*/,
out s /*StreamIds*/);
Console.WriteLine("Length: " + pout.Length);
Console.ReadLine();
}
}
}
"Jerry" wrote:
> In SSRS 2000 SP2 the documentation for ReportingService.Render states that
> the ParametersUsed output parameter should only be populated only if the
> report being rendered is a report history snapshot. I'm invoking the Render
> method with a null HistoryId as follows, so I would expect the ParametersUsed
> output parameter not to get populated.
> results = m_RptService.Render(m_RptCatalogItem.Path /*Report*/,
> m_Format /*Format*/,
> null /*HistoryID*/,
> null /*DeviceInfo*/,
> m_RptParameters /*Parameters*/,
> null /*Credentials*/,
> null /*ShowHideToggle*/,
> out encoding /*Encoding*/,
> out mimeType /*MimeType*/,
> out historyParms /*ParametersUsed*/,
> out warnings /*Warnings*/,
> out streamIDs /*StreamIds*/);
> The call generates the following HTTP traffic. As you can see the HistoryId
> is not sent in the request yet ParametersUsed is populated in the result. If
> I'm interpreting the documentation correctly this value should not be
> populated in the response. I really don't what ParametersUsed to be
> populated in the response. Is this the correct behavior?
> POST /ReportServer/ReportService.asmx HTTP/1.1
> Content-Type: text/xml; charset=utf-8
> SOAPAction:
> "http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices/Render"
> Content-Length: 524
> Expect: 100-continue
> Host: localhost
> Cookie: sqlAuthCookie=****; UsrTkn=>****; AppTkn=>****
> <?xml version="1.0" encoding="utf-8"?><soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="<soap:Body><Render">http://www.w3.org/2001/XMLSchema"><soap:Body><Render
> xmlns="<Report>/ReportServerStatistics/PTest</Report><Format>HTML4.0</Format><Parameters><ParameterValue><Name>p1</Name><Value>2/11/2007">http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices"><Report>/ReportServerStatistics/PTest</Report><Format>HTML4.0</Format><Parameters><ParameterValue><Name>p1</Name><Value>2/11/2007
> 7:32:50
> PM</Value></ParameterValue></Parameters></Render></soap:Body></soap:Envelope>
> HTTP/1.1 200 OK
> Date: Mon, 12 Feb 2007 00:32:50 GMT
> Server: Microsoft-IIS/6.0
> X-Powered-By: ASP.NET
> X-AspNet-Version: 1.1.4322
> Cache-Control: private, max-age=0
> Content-Type: text/xml; charset=utf-8
> Content-Length: 9021
> <?xml version="1.0" encoding="utf-8"?><soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="<soap:Header><ServerInfoHeader">http://www.w3.org/2001/XMLSchema"><soap:Header><ServerInfoHeader
> xmlns="<ReportServerVersionNumber>Microsoft">http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices"><ReportServerVersionNumber>Microsoft
> SQL Server Reporting Services Version
> 8.00.1038.00</ReportServerVersionNumber><ReportServerEdition>Enterprise</ReportServerEdition></ServerInfoHeader><SessionHeader
> xmlns="<SessionId>glbci3rl3utt1iqmon253t45</SessionId><IsNewExecution>true</IsNewExecution><ExecutionDateTime>2007-02-11T19:32:50</ExecutionDateTime><ExpirationDateTime>2007-02-11T19:32:50</ExpirationDateTime></SessionHeader></soap:Header><soap:Body><RenderResponse">http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices"><SessionId>glbci3rl3utt1iqmon253t45</SessionId><IsNewExecution>true</IsNewExecution><ExecutionDateTime>2007-02-11T19:32:50</ExecutionDateTime><ExpirationDateTime>2007-02-11T19:32:50</ExpirationDateTime></SessionHeader></soap:Header><soap:Body><RenderResponse
> xmlns="<Result>">http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices"><Result>
> Base 64 Encoded response removed to shorten post
> </Result><Encoding>Unicode
> (UTF-8)</Encoding><MimeType>text/html</MimeType><ParametersUsed><ParameterValue><Name>p1</Name><Value>2/11/2007
> 7:32:50 PM</Value></ParameterValue></ParametersUsed><StreamIds
> /></RenderResponse></soap:Body></soap:Envelope>
>
Friday, March 9, 2012
Parameters in url to make GIF question.
then instantly convert it into a .GIF file?
thanks,
TrintTrint,
There isn't a parameter you can pass to get an exported parameter as a gif
file.
Take a look at the url below to view supported export formats:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rswork/htm/rwp_workingreports_v1_3nxt.asp
The below link shows the available URL access params:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_prog_urlaccess_374y.asp
Adrian M.
"trint" <trinity.smith@.gmail.com> wrote in message
news:1105737359.995271.243600@.z14g2000cwz.googlegroups.com...
> What parameter can I send from my app that will render the report and
> then instantly convert it into a .GIF file?
> thanks,
> Trint
>|||I know TIFF but can you export to GIF also. ?
for TIFF you supply
rsFormat=IMAGE along with other report parameters.
"trint" <trinity.smith@.gmail.com> wrote in message
news:1105737359.995271.243600@.z14g2000cwz.googlegroups.com...
> What parameter can I send from my app that will render the report and
> then instantly convert it into a .GIF file?
> thanks,
> Trint
>|||OK,
I figured out how to render .gif...here it is:
"The Image rendering extension renders a report to a bitmap or
metafile. By default, the Image rendering extension produces a TIFF
file of the report, which can be viewed in multiple pages. When the
client receives the image, it can be displayed in an image viewer and
printed.
The Image rendering extension can generate files in any of the formats
supported by GDI+: BMP, EMF, GIF, JPEG, PNG, and TIFF. For TIFF format,
the file name of the primary stream is ReportName.tif. For all other
formats, which render as a single page per file, the file name is
ReportName_Page.ext where ext is the file extension for the chosen
format.
"
Trint
Vaibhav wrote:
> I know TIFF but can you export to GIF also. ?
> for TIFF you supply
> rsFormat=IMAGE along with other report parameters.
> "trint" <trinity.smith@.gmail.com> wrote in message
> news:1105737359.995271.243600@.z14g2000cwz.googlegroups.com...
> > What parameter can I send from my app that will render the report
and
> > then instantly convert it into a .GIF file?
> > thanks,
> > Trint
> >
Wednesday, March 7, 2012
Parameters ignored, Render report from VB .Net application
I seem to be unable to pass parameters from a VB .Net application to Reporting Services.
Before I added the parameters to the query, I got all the rows back. So I know the application is basically working. Now that I have added the parameters, I get nothing.
I thought the SetExecutionParameters function would help, but my syntax is wrong and it fails.
I would appreciate any hint as to what step I am missing.
Report setup:
Parameters
Name Value
@.Report =Parameters!Report.Value
@.Corp =Parameters!Corp.Value
@.Dept =Parameters!Dept.Value
Query conditions
WHERE Report = 'BudgetVarianceSummary'
AND PeriodEnd = CONVERT(DateTime,CONVERT(char,GETDATE()- DATEPART(day,GETDATE()),112))
AND Report = @.Report
AND Corp = @.Corp
AND Dept = @.Dept
VB Code snippet:
Dim reportPath As String = "/FinancialReports/BudgetVarianceSummary"
Dim format As String = "PDF"
' Prepare report parameter.
Dim parameters(3) As ParameterValue
parameters(0) = New ParameterValue()
parameters(0).Name = "Report"
parameters(0).Value = "BudgetVarianceSummary"
parameters(1) = New ParameterValue()
parameters(1).Name = "Corp"
parameters(1).Value = "10"
parameters(2) = New ParameterValue()
parameters(2).Name = "Dept"
parameters(2).Value = "7255"
Dim execInfo As New ExecutionInfo
Dim execHeader As New ExecutionHeader()
Dim SessionId As String
Dim extension As String = ""
rs.ExecutionHeaderValue = execHeader
execInfo = rs.LoadReport(reportPath, historyID)
'This line of code fails
'rs.SetExecutionParameters(parameters, "en-us")
result = rs.Render(format, devInfo, extension, encoding, mimeType, warnings, streamIDs)
Dim DateiName As String = Benutzer.Benutzer & "_" & Date.Now.ToString("yyMMdd_HHMMss") & ".pdf"
Dim rs As New ReportingServices.ReportExecutionService
Dim Info As New ReportingServices.ExecutionInfo
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim parameters(1) As ReportingServices.ParameterValue
parameters(0) = New ReportingServices.ParameterValue()
parameters(0).Name = "KB"
parameters(0).Value = _KB
parameters(1) = New ReportingServices.ParameterValue()
parameters(1).Name = "KBG"
parameters(1).Value = CStr(_IDKBG)
Info = rs.LoadReport("/SOR/KBGDruck10", Nothing)
rs.SetExecutionParameters(parameters, "de-ch")
Dim results() As Byte
results = rs.Render("PDF", "", "", "", "", Nothing, Nothing)
Dim Stream As System.IO.FileStream = System.IO.File.OpenWrite(DateiName)
Stream.Write(results, 0, results.Length)
Stream.Close()
Windows.Forms.Cursor.Current = Cursors.Default
Try
Diagnostics.Process.Start(DateiName)
Catch ex As Exception
End Try
XInfo("", "")
Parameters ignored, Render report from VB .Net application
I seem to be unable to pass parameters from a VB .Net application to Reporting Services.
Before I added the parameters to the query, I got all the rows back. So I know the application is basically working. Now that I have added the parameters, I get nothing.
I thought the SetExecutionParameters function would help, but my syntax is wrong and it fails.
I would appreciate any hint as to what step I am missing.
Report setup:
Parameters
Name Value
@.Report =Parameters!Report.Value
@.Corp =Parameters!Corp.Value
@.Dept =Parameters!Dept.Value
Query conditions
WHERE Report = 'BudgetVarianceSummary'
AND PeriodEnd = CONVERT(DateTime,CONVERT(char,GETDATE()- DATEPART(day,GETDATE()),112))
AND Report = @.Report
AND Corp = @.Corp
AND Dept = @.Dept
VB Code snippet:
Dim reportPath As String = "/FinancialReports/BudgetVarianceSummary"
Dim format As String = "PDF"
' Prepare report parameter.
Dim parameters(3) As ParameterValue
parameters(0) = New ParameterValue()
parameters(0).Name = "Report"
parameters(0).Value = "BudgetVarianceSummary"
parameters(1) = New ParameterValue()
parameters(1).Name = "Corp"
parameters(1).Value = "10"
parameters(2) = New ParameterValue()
parameters(2).Name = "Dept"
parameters(2).Value = "7255"
Dim execInfo As New ExecutionInfo
Dim execHeader As New ExecutionHeader()
Dim SessionId As String
Dim extension As String = ""
rs.ExecutionHeaderValue = execHeader
execInfo = rs.LoadReport(reportPath, historyID)
'This line of code fails
'rs.SetExecutionParameters(parameters, "en-us")
result = rs.Render(format, devInfo, extension, encoding, mimeType, warnings, streamIDs)
Dim DateiName As String = Benutzer.Benutzer & "_" & Date.Now.ToString("yyMMdd_HHMMss") & ".pdf"
Dim rs As New ReportingServices.ReportExecutionService
Dim Info As New ReportingServices.ExecutionInfo
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim parameters(1) As ReportingServices.ParameterValue
parameters(0) = New ReportingServices.ParameterValue()
parameters(0).Name = "KB"
parameters(0).Value = _KB
parameters(1) = New ReportingServices.ParameterValue()
parameters(1).Name = "KBG"
parameters(1).Value = CStr(_IDKBG)
Info = rs.LoadReport("/SOR/KBGDruck10", Nothing)
rs.SetExecutionParameters(parameters, "de-ch")
Dim results() As Byte
results = rs.Render("PDF", "", "", "", "", Nothing, Nothing)
Dim Stream As System.IO.FileStream = System.IO.File.OpenWrite(DateiName)
Stream.Write(results, 0, results.Length)
Stream.Close()
Windows.Forms.Cursor.Current = Cursors.Default
Try
Diagnostics.Process.Start(DateiName)
Catch ex As Exception
End Try
XInfo("", "")