Showing posts with label format. Show all posts
Showing posts with label format. Show all posts

Friday, March 30, 2012

ReportViewer Extract DropDown

All,
I am using the ASP.Net ReportViewer control, but I cannot extract data
because the extract format type dropdown is not visible in the control. I
have the ShowExtractControls property set to True and I can see the Extract
link, but it is disabled
Is there something else I need to configure to allow the dropdown to populate?On Dec 19, 4:10 pm, Rex Mahel <Rex Ma...@.discussions.microsoft.com>
wrote:
> All,
> I am using the ASP.Net ReportViewer control, but I cannot extract data
> because the extract format type dropdown is not visible in the control. I
> have the ShowExtractControls property set to True and I can see the Extract
> link, but it is disabled
> Is there something else I need to configure to allow the dropdown to populate?
This link might be helpful.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1968399&SiteID=1
Also, you might try checking: C:\Program Files\Microsoft SQL Server
\MSSQL.2\Reporting Services\ReportServer\rsreportserver.config (...
\MSSQL.2\... could be ...\MSSQL.3\... based on if you have SSIS/SSAS
installed). Of course, this would be a long shot. Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||Looked through the link, checked the cache issue, "Do not save exrypted pages
to disk" was unchecked, checked C:\Windows\Temp security properties and
granted full control to SQLServer2005ReportingServicesWebServiceUser user.
Nothing had any effect.
Any other ideas?
"EMartinez" wrote:
> On Dec 19, 4:10 pm, Rex Mahel <Rex Ma...@.discussions.microsoft.com>
> wrote:
> > All,
> >
> > I am using the ASP.Net ReportViewer control, but I cannot extract data
> > because the extract format type dropdown is not visible in the control. I
> > have the ShowExtractControls property set to True and I can see the Extract
> > link, but it is disabled
> >
> > Is there something else I need to configure to allow the dropdown to populate?
>
> This link might be helpful.
> http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1968399&SiteID=1
> Also, you might try checking: C:\Program Files\Microsoft SQL Server
> \MSSQL.2\Reporting Services\ReportServer\rsreportserver.config (...
> \MSSQL.2\... could be ...\MSSQL.3\... based on if you have SSIS/SSAS
> installed). Of course, this would be a long shot. Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>

ReportViewer Export PDF (Huge size) Workaround

If you have a chart or image in your reportviewer and you want to export file in PDF format, you will have an unusable big size pdf file.

Here is a work around fromsnapApps:(1/19/2007)

"snapApps createda solution for this problem. It involves disabling the export featurefrom the reportViewer toolbar and rendering the PDF through a custombutton. That's the easy part. Then you just use our PDFCompress libraryto compress the image streams contained within the PDF. You candownload PDFCompress athttp://www.snapapps.com/Components.aspx."

Hope this helps someone.

Hi,

I found a possible solution for this:

Download Orcas 2 Beta (I used the Virtual PC image, but the regular installation should work)

Look for:

Microsoft.ReportViewer.Common.dll

Microsoft.ReportViewer.WebForms.dll

Microsoft.ReportViewer.ProcessingObjectModel.dll

Note that the ProcessingObjectModel is in the global assembly cache. The way I was able to copy it was by going to the command line and doing adir Microsoft.ReportViewer.ProcessingObjectModel.dll /sin the root of the c drive. Then I found the location of the file, changed directory and copied the file to a previously created directory.

Make sure that the files that you pick are version 9.0.0.0!

Copy all those files and add the references in your VS2005 project. It seems that the ReportViewer version 9.0.0.0 which is in Orca is compatible with .NET 2.0.

Next, replace all references to 8.0.0.0 in any page that uses the report viewer with 9.0.0.0. Also, the web.config file has a reference to report viewer, make sure you substitute 8.0.0.0 for 9.0.0.0.

I have tested this method and it works. Make sure that the bin directory of your deployed application has the three files above.

reportviewer error?

I am getting the following error when I call. Any help would be appreciated.
ReportViewer1.ServerReport.Render(format, devInfo, out mimeType, out
encoding, out extension, out streamIds, out warnings);
Error:
"Client found response content type of '', but expected 'text/xml'"
below is the code I use.
MyRS.ReportViewerCredentials rvwCreds = new
MyRS.ReportViewerCredentials(userName, pass,"");
ReportViewer1.ServerReport.ReportServerCredentials = rvwCreds;
ReportViewer1.ServerReport.ReportServerUrl = new
System.Uri(ConfigurationManager.AppSettings.Get("rsUrl"));
ReportViewer1.ServerReport.ReportPath = "/benefit reports/Employee
Roster?sys_id=16&effdt=" +
HttpContext.Current.Request.QueryString.Get("asof").ToString();
string encoding = "";
string mimeType;
Microsoft.Reporting.WebForms.Warning[] warnings;
string[] streamIds;
string format = "HTML4.0";
string extension = "";
string devInfo = @."<DeviceInfo>" +
"<Toolbar>True</Toolbar>" +
"<Parameters>True</Parameters>" +
"<DocMap>True</DocMap>" +
"<Zoom>100</Zoom>" +
"</DeviceInfo>";
ReportViewer1.ServerReport.Render(format, devInfo, out mimeType, out
encoding, out extension, out streamIds, out warnings);using the SOAP access you can't provide the parameters in the reportpath
property.
its not an URL access.
the reportpath property must contain ONLY the report path (ie: "/benefit
reports/Employee Roster"
you have to use the parameters objects to send your parameters to the
report.
"dgator" <dgator@.discussions.microsoft.com> wrote in message
news:3DC2CCC0-569F-421B-9D6F-61E0B9459B6B@.microsoft.com...
>I am getting the following error when I call. Any help would be
>appreciated.
> ReportViewer1.ServerReport.Render(format, devInfo, out mimeType, out
> encoding, out extension, out streamIds, out warnings);
> Error:
> "Client found response content type of '', but expected 'text/xml'"
> below is the code I use.
> MyRS.ReportViewerCredentials rvwCreds = new
> MyRS.ReportViewerCredentials(userName, pass,"");
> ReportViewer1.ServerReport.ReportServerCredentials = rvwCreds;
> ReportViewer1.ServerReport.ReportServerUrl = new
> System.Uri(ConfigurationManager.AppSettings.Get("rsUrl"));
> ReportViewer1.ServerReport.ReportPath = "/benefit reports/Employee
> Roster?sys_id=16&effdt=" +
> HttpContext.Current.Request.QueryString.Get("asof").ToString();
> string encoding = "";
> string mimeType;
> Microsoft.Reporting.WebForms.Warning[] warnings;
> string[] streamIds;
> string format = "HTML4.0";
> string extension = "";
> string devInfo = @."<DeviceInfo>" +
> "<Toolbar>True</Toolbar>" +
> "<Parameters>True</Parameters>" +
> "<DocMap>True</DocMap>" +
> "<Zoom>100</Zoom>" +
> "</DeviceInfo>";
>
> ReportViewer1.ServerReport.Render(format, devInfo, out mimeType,
> out
> encoding, out extension, out streamIds, out warnings);
>|||I did as you said and still get this message
"Client found response content type of '', but expected 'text/xml'.\r\nThe
request failed with an empty response."
It throws the error on the SetParameters line now. If I comment out the
setting of parameters, it throws the same error on the "Render" command.
Here is my code
string userName = ConfigurationManager.AppSettings.Get("rptUser").ToString();
string pass =ConfigurationManager.AppSettings.Get("rptPassword").ToString();
MyRS.ReportViewerCredentials rvwCreds = new
MyRS.ReportViewerCredentials(userName, pass,"");
ReportViewer1.ServerReport.ReportServerCredentials = rvwCreds;
ReportViewer1.ServerReport.ReportServerUrl = new
System.Uri(ConfigurationManager.AppSettings.Get("rsUrl"));
ReportViewer1.ServerReport.ReportPath = "/benefit reports/Employee
Roster";
string sys_id =HttpContext.Current.Request.QueryString.Get("sys_id").ToString();
string asof =HttpContext.Current.Request.QueryString.Get("asof").ToString();
ReportParameter param1 = new ReportParameter("sys_id", sys_id);
ReportParameter param2 = new ReportParameter("effdt", asof);
ReportViewer1.ServerReport.SetParameters(new ReportParameter[] {
param1, param2 });
string encoding = "";
string mimeType;
Microsoft.Reporting.WebForms.Warning[] warnings;
string[] streamIds;
string format = "HTML4.0";
string extension = "";
string devInfo = @."<DeviceInfo>" +
"<Toolbar>True</Toolbar>" +
"<Parameters>True</Parameters>" +
"<DocMap>True</DocMap>" +
"<Zoom>100</Zoom>" +
"</DeviceInfo>";
ReportViewer1.ServerReport.Render(format, devInfo, out mimeType, out
encoding, out extension, out streamIds, out warnings);
"Jéjé" wrote:
> using the SOAP access you can't provide the parameters in the reportpath
> property.
> its not an URL access.
> the reportpath property must contain ONLY the report path (ie: "/benefit
> reports/Employee Roster"
> you have to use the parameters objects to send your parameters to the
> report.
>
> "dgator" <dgator@.discussions.microsoft.com> wrote in message
> news:3DC2CCC0-569F-421B-9D6F-61E0B9459B6B@.microsoft.com...
> >I am getting the following error when I call. Any help would be
> >appreciated.
> >
> > ReportViewer1.ServerReport.Render(format, devInfo, out mimeType, out
> > encoding, out extension, out streamIds, out warnings);
> >
> > Error:
> > "Client found response content type of '', but expected 'text/xml'"
> >
> > below is the code I use.
> >
> > MyRS.ReportViewerCredentials rvwCreds = new
> > MyRS.ReportViewerCredentials(userName, pass,"");
> > ReportViewer1.ServerReport.ReportServerCredentials = rvwCreds;
> >
> > ReportViewer1.ServerReport.ReportServerUrl = new
> > System.Uri(ConfigurationManager.AppSettings.Get("rsUrl"));
> > ReportViewer1.ServerReport.ReportPath = "/benefit reports/Employee
> > Roster?sys_id=16&effdt=" +
> > HttpContext.Current.Request.QueryString.Get("asof").ToString();
> >
> > string encoding = "";
> > string mimeType;
> > Microsoft.Reporting.WebForms.Warning[] warnings;
> > string[] streamIds;
> > string format = "HTML4.0";
> > string extension = "";
> > string devInfo = @."<DeviceInfo>" +
> > "<Toolbar>True</Toolbar>" +
> > "<Parameters>True</Parameters>" +
> > "<DocMap>True</DocMap>" +
> > "<Zoom>100</Zoom>" +
> > "</DeviceInfo>";
> >
> >
> > ReportViewer1.ServerReport.Render(format, devInfo, out mimeType,
> > out
> > encoding, out extension, out streamIds, out warnings);
> >
> >
>
>|||do you use RS 2005?
the new reportviewer control works with RS2005 only.
the devinfo parameters are optional, because the control provides a lot of
properties like zoom, showdocmap etc...
also this control do the rendering by himself, there is no need to call the
render method.
Put the control on your asp.net page, change the parameters and options, run
the page and you'll see the result or a more detailed error.
but, maybe there is a problem at the reportserver virtual directory himself.
"dgator" <dgator@.discussions.microsoft.com> wrote in message
news:C0581095-ED38-4960-87C3-E478454B9D33@.microsoft.com...
>I did as you said and still get this message
> "Client found response content type of '', but expected 'text/xml'.\r\nThe
> request failed with an empty response."
> It throws the error on the SetParameters line now. If I comment out the
> setting of parameters, it throws the same error on the "Render" command.
> Here is my code
> string userName => ConfigurationManager.AppSettings.Get("rptUser").ToString();
> string pass => ConfigurationManager.AppSettings.Get("rptPassword").ToString();
> MyRS.ReportViewerCredentials rvwCreds = new
> MyRS.ReportViewerCredentials(userName, pass,"");
> ReportViewer1.ServerReport.ReportServerCredentials = rvwCreds;
> ReportViewer1.ServerReport.ReportServerUrl = new
> System.Uri(ConfigurationManager.AppSettings.Get("rsUrl"));
> ReportViewer1.ServerReport.ReportPath = "/benefit reports/Employee
> Roster";
> string sys_id => HttpContext.Current.Request.QueryString.Get("sys_id").ToString();
> string asof => HttpContext.Current.Request.QueryString.Get("asof").ToString();
> ReportParameter param1 = new ReportParameter("sys_id", sys_id);
> ReportParameter param2 = new ReportParameter("effdt", asof);
> ReportViewer1.ServerReport.SetParameters(new ReportParameter[] {
> param1, param2 });
>
> string encoding = "";
> string mimeType;
> Microsoft.Reporting.WebForms.Warning[] warnings;
> string[] streamIds;
> string format = "HTML4.0";
> string extension = "";
> string devInfo = @."<DeviceInfo>" +
> "<Toolbar>True</Toolbar>" +
> "<Parameters>True</Parameters>" +
> "<DocMap>True</DocMap>" +
> "<Zoom>100</Zoom>" +
> "</DeviceInfo>";
>
> ReportViewer1.ServerReport.Render(format, devInfo, out mimeType,
> out
> encoding, out extension, out streamIds, out warnings);
>
> "Jéjé" wrote:
>> using the SOAP access you can't provide the parameters in the reportpath
>> property.
>> its not an URL access.
>> the reportpath property must contain ONLY the report path (ie: "/benefit
>> reports/Employee Roster"
>> you have to use the parameters objects to send your parameters to the
>> report.
>>
>> "dgator" <dgator@.discussions.microsoft.com> wrote in message
>> news:3DC2CCC0-569F-421B-9D6F-61E0B9459B6B@.microsoft.com...
>> >I am getting the following error when I call. Any help would be
>> >appreciated.
>> >
>> > ReportViewer1.ServerReport.Render(format, devInfo, out mimeType, out
>> > encoding, out extension, out streamIds, out warnings);
>> >
>> > Error:
>> > "Client found response content type of '', but expected 'text/xml'"
>> >
>> > below is the code I use.
>> >
>> > MyRS.ReportViewerCredentials rvwCreds = new
>> > MyRS.ReportViewerCredentials(userName, pass,"");
>> > ReportViewer1.ServerReport.ReportServerCredentials = rvwCreds;
>> >
>> > ReportViewer1.ServerReport.ReportServerUrl = new
>> > System.Uri(ConfigurationManager.AppSettings.Get("rsUrl"));
>> > ReportViewer1.ServerReport.ReportPath = "/benefit
>> > reports/Employee
>> > Roster?sys_id=16&effdt=" +
>> > HttpContext.Current.Request.QueryString.Get("asof").ToString();
>> >
>> > string encoding = "";
>> > string mimeType;
>> > Microsoft.Reporting.WebForms.Warning[] warnings;
>> > string[] streamIds;
>> > string format = "HTML4.0";
>> > string extension = "";
>> > string devInfo = @."<DeviceInfo>" +
>> > "<Toolbar>True</Toolbar>" +
>> > "<Parameters>True</Parameters>" +
>> > "<DocMap>True</DocMap>" +
>> > "<Zoom>100</Zoom>" +
>> > "</DeviceInfo>";
>> >
>> >
>> > ReportViewer1.ServerReport.Render(format, devInfo, out mimeType,
>> > out
>> > encoding, out extension, out streamIds, out warnings);
>> >
>> >
>>|||Yes, I use rs 2005.
I have reduced the code to the following and still get the issue.
ReportViewer1.ServerReport.ReportServerUrl = new
System.Uri(ConfigurationManager.AppSettings.Get("rsUrl"));
ReportViewer1.ServerReport.ReportPath = "/benefit reports/ppl";
ReportViewer1.ProcessingMode = ProcessingMode.Remote;
ReportViewer1.ServerReport.Refresh();
Any other thoughts? What about the settings on the virtual directory. I
have tried this on two different development machines.
Thanks
"Jéjé" wrote:
> do you use RS 2005?
> the new reportviewer control works with RS2005 only.
> the devinfo parameters are optional, because the control provides a lot of
> properties like zoom, showdocmap etc...
> also this control do the rendering by himself, there is no need to call the
> render method.
> Put the control on your asp.net page, change the parameters and options, run
> the page and you'll see the result or a more detailed error.
> but, maybe there is a problem at the reportserver virtual directory himself.
> "dgator" <dgator@.discussions.microsoft.com> wrote in message
> news:C0581095-ED38-4960-87C3-E478454B9D33@.microsoft.com...
> >I did as you said and still get this message
> >
> > "Client found response content type of '', but expected 'text/xml'.\r\nThe
> > request failed with an empty response."
> >
> > It throws the error on the SetParameters line now. If I comment out the
> > setting of parameters, it throws the same error on the "Render" command.
> >
> > Here is my code
> >
> > string userName => > ConfigurationManager.AppSettings.Get("rptUser").ToString();
> > string pass => > ConfigurationManager.AppSettings.Get("rptPassword").ToString();
> >
> > MyRS.ReportViewerCredentials rvwCreds = new
> > MyRS.ReportViewerCredentials(userName, pass,"");
> > ReportViewer1.ServerReport.ReportServerCredentials = rvwCreds;
> >
> > ReportViewer1.ServerReport.ReportServerUrl = new
> > System.Uri(ConfigurationManager.AppSettings.Get("rsUrl"));
> > ReportViewer1.ServerReport.ReportPath = "/benefit reports/Employee
> > Roster";
> >
> > string sys_id => > HttpContext.Current.Request.QueryString.Get("sys_id").ToString();
> > string asof => > HttpContext.Current.Request.QueryString.Get("asof").ToString();
> >
> > ReportParameter param1 = new ReportParameter("sys_id", sys_id);
> >
> > ReportParameter param2 = new ReportParameter("effdt", asof);
> >
> > ReportViewer1.ServerReport.SetParameters(new ReportParameter[] {
> > param1, param2 });
> >
> >
> > string encoding = "";
> > string mimeType;
> > Microsoft.Reporting.WebForms.Warning[] warnings;
> > string[] streamIds;
> > string format = "HTML4.0";
> > string extension = "";
> > string devInfo = @."<DeviceInfo>" +
> > "<Toolbar>True</Toolbar>" +
> > "<Parameters>True</Parameters>" +
> > "<DocMap>True</DocMap>" +
> > "<Zoom>100</Zoom>" +
> > "</DeviceInfo>";
> >
> >
> > ReportViewer1.ServerReport.Render(format, devInfo, out mimeType,
> > out
> > encoding, out extension, out streamIds, out warnings);
> >
> >
> > "Jéjé" wrote:
> >
> >> using the SOAP access you can't provide the parameters in the reportpath
> >> property.
> >> its not an URL access.
> >>
> >> the reportpath property must contain ONLY the report path (ie: "/benefit
> >> reports/Employee Roster"
> >>
> >> you have to use the parameters objects to send your parameters to the
> >> report.
> >>
> >>
> >> "dgator" <dgator@.discussions.microsoft.com> wrote in message
> >> news:3DC2CCC0-569F-421B-9D6F-61E0B9459B6B@.microsoft.com...
> >> >I am getting the following error when I call. Any help would be
> >> >appreciated.
> >> >
> >> > ReportViewer1.ServerReport.Render(format, devInfo, out mimeType, out
> >> > encoding, out extension, out streamIds, out warnings);
> >> >
> >> > Error:
> >> > "Client found response content type of '', but expected 'text/xml'"
> >> >
> >> > below is the code I use.
> >> >
> >> > MyRS.ReportViewerCredentials rvwCreds = new
> >> > MyRS.ReportViewerCredentials(userName, pass,"");
> >> > ReportViewer1.ServerReport.ReportServerCredentials = rvwCreds;
> >> >
> >> > ReportViewer1.ServerReport.ReportServerUrl = new
> >> > System.Uri(ConfigurationManager.AppSettings.Get("rsUrl"));
> >> > ReportViewer1.ServerReport.ReportPath = "/benefit
> >> > reports/Employee
> >> > Roster?sys_id=16&effdt=" +
> >> > HttpContext.Current.Request.QueryString.Get("asof").ToString();
> >> >
> >> > string encoding = "";
> >> > string mimeType;
> >> > Microsoft.Reporting.WebForms.Warning[] warnings;
> >> > string[] streamIds;
> >> > string format = "HTML4.0";
> >> > string extension = "";
> >> > string devInfo = @."<DeviceInfo>" +
> >> > "<Toolbar>True</Toolbar>" +
> >> > "<Parameters>True</Parameters>" +
> >> > "<DocMap>True</DocMap>" +
> >> > "<Zoom>100</Zoom>" +
> >> > "</DeviceInfo>";
> >> >
> >> >
> >> > ReportViewer1.ServerReport.Render(format, devInfo, out mimeType,
> >> > out
> >> > encoding, out extension, out streamIds, out warnings);
> >> >
> >> >
> >>
> >>
> >>
>
>|||have you impersonate your application?
does RS works fine? (http://localhost/reportserver?/benefit reports/ppl)
"dgator" <dgator@.discussions.microsoft.com> wrote in message
news:CDC10304-8DEE-4938-B624-84DAE034F43E@.microsoft.com...
> Yes, I use rs 2005.
> I have reduced the code to the following and still get the issue.
> ReportViewer1.ServerReport.ReportServerUrl = new
> System.Uri(ConfigurationManager.AppSettings.Get("rsUrl"));
> ReportViewer1.ServerReport.ReportPath = "/benefit reports/ppl";
> ReportViewer1.ProcessingMode = ProcessingMode.Remote;
> ReportViewer1.ServerReport.Refresh();
> Any other thoughts? What about the settings on the virtual directory. I
> have tried this on two different development machines.
> Thanks
> "Jéjé" wrote:
>> do you use RS 2005?
>> the new reportviewer control works with RS2005 only.
>> the devinfo parameters are optional, because the control provides a lot
>> of
>> properties like zoom, showdocmap etc...
>> also this control do the rendering by himself, there is no need to call
>> the
>> render method.
>> Put the control on your asp.net page, change the parameters and options,
>> run
>> the page and you'll see the result or a more detailed error.
>> but, maybe there is a problem at the reportserver virtual directory
>> himself.
>> "dgator" <dgator@.discussions.microsoft.com> wrote in message
>> news:C0581095-ED38-4960-87C3-E478454B9D33@.microsoft.com...
>> >I did as you said and still get this message
>> >
>> > "Client found response content type of '', but expected
>> > 'text/xml'.\r\nThe
>> > request failed with an empty response."
>> >
>> > It throws the error on the SetParameters line now. If I comment out
>> > the
>> > setting of parameters, it throws the same error on the "Render"
>> > command.
>> >
>> > Here is my code
>> >
>> > string userName =>> > ConfigurationManager.AppSettings.Get("rptUser").ToString();
>> > string pass =>> > ConfigurationManager.AppSettings.Get("rptPassword").ToString();
>> >
>> > MyRS.ReportViewerCredentials rvwCreds = new
>> > MyRS.ReportViewerCredentials(userName, pass,"");
>> > ReportViewer1.ServerReport.ReportServerCredentials = rvwCreds;
>> >
>> > ReportViewer1.ServerReport.ReportServerUrl = new
>> > System.Uri(ConfigurationManager.AppSettings.Get("rsUrl"));
>> > ReportViewer1.ServerReport.ReportPath = "/benefit
>> > reports/Employee
>> > Roster";
>> >
>> > string sys_id =>> > HttpContext.Current.Request.QueryString.Get("sys_id").ToString();
>> > string asof =>> > HttpContext.Current.Request.QueryString.Get("asof").ToString();
>> >
>> > ReportParameter param1 = new ReportParameter("sys_id", sys_id);
>> >
>> > ReportParameter param2 = new ReportParameter("effdt", asof);
>> >
>> > ReportViewer1.ServerReport.SetParameters(new ReportParameter[] {
>> > param1, param2 });
>> >
>> >
>> > string encoding = "";
>> > string mimeType;
>> > Microsoft.Reporting.WebForms.Warning[] warnings;
>> > string[] streamIds;
>> > string format = "HTML4.0";
>> > string extension = "";
>> > string devInfo = @."<DeviceInfo>" +
>> > "<Toolbar>True</Toolbar>" +
>> > "<Parameters>True</Parameters>" +
>> > "<DocMap>True</DocMap>" +
>> > "<Zoom>100</Zoom>" +
>> > "</DeviceInfo>";
>> >
>> >
>> > ReportViewer1.ServerReport.Render(format, devInfo, out mimeType,
>> > out
>> > encoding, out extension, out streamIds, out warnings);
>> >
>> >
>> > "Jéjé" wrote:
>> >
>> >> using the SOAP access you can't provide the parameters in the
>> >> reportpath
>> >> property.
>> >> its not an URL access.
>> >>
>> >> the reportpath property must contain ONLY the report path (ie:
>> >> "/benefit
>> >> reports/Employee Roster"
>> >>
>> >> you have to use the parameters objects to send your parameters to the
>> >> report.
>> >>
>> >>
>> >> "dgator" <dgator@.discussions.microsoft.com> wrote in message
>> >> news:3DC2CCC0-569F-421B-9D6F-61E0B9459B6B@.microsoft.com...
>> >> >I am getting the following error when I call. Any help would be
>> >> >appreciated.
>> >> >
>> >> > ReportViewer1.ServerReport.Render(format, devInfo, out mimeType, out
>> >> > encoding, out extension, out streamIds, out warnings);
>> >> >
>> >> > Error:
>> >> > "Client found response content type of '', but expected 'text/xml'"
>> >> >
>> >> > below is the code I use.
>> >> >
>> >> > MyRS.ReportViewerCredentials rvwCreds = new
>> >> > MyRS.ReportViewerCredentials(userName, pass,"");
>> >> > ReportViewer1.ServerReport.ReportServerCredentials =>> >> > rvwCreds;
>> >> >
>> >> > ReportViewer1.ServerReport.ReportServerUrl = new
>> >> > System.Uri(ConfigurationManager.AppSettings.Get("rsUrl"));
>> >> > ReportViewer1.ServerReport.ReportPath = "/benefit
>> >> > reports/Employee
>> >> > Roster?sys_id=16&effdt=" +
>> >> > HttpContext.Current.Request.QueryString.Get("asof").ToString();
>> >> >
>> >> > string encoding = "";
>> >> > string mimeType;
>> >> > Microsoft.Reporting.WebForms.Warning[] warnings;
>> >> > string[] streamIds;
>> >> > string format = "HTML4.0";
>> >> > string extension = "";
>> >> > string devInfo = @."<DeviceInfo>" +
>> >> > "<Toolbar>True</Toolbar>" +
>> >> > "<Parameters>True</Parameters>" +
>> >> > "<DocMap>True</DocMap>" +
>> >> > "<Zoom>100</Zoom>" +
>> >> > "</DeviceInfo>";
>> >> >
>> >> >
>> >> > ReportViewer1.ServerReport.Render(format, devInfo, out
>> >> > mimeType,
>> >> > out
>> >> > encoding, out extension, out streamIds, out warnings);
>> >> >
>> >> >
>> >>
>> >>
>> >>
>>sql

Monday, March 26, 2012

ReportService Web Service Date Parameter Format

Hi all,
In my web service call, I pass the date value to the reporting services in
the format of yyyy-MM-dd. But the reporting service interpret the date value
in a strange way. When I select 9 Mar 2007, It convert the date to 3 Sep
2007. However, when I select 13 Mar 2007, It remain as 13 Mar 2007 !!!
The date format is the same when I use visual studio to launch the web
application. When I deploy it to IIS, I have encountered the above problem.
I have changed the web server locale to en-US and my report server is also
en-US. This makes no difference.
Could someone help? Thx.On Mar 9, 6:13 am, Cloud <C...@.discussions.microsoft.com> wrote:
> Hi all,
> In my web service call, I pass the date value to the reporting services in
> the format of yyyy-MM-dd. But the reporting service interpret the date value
> in a strange way. When I select 9 Mar 2007, It convert the date to 3 Sep
> 2007. However, when I select 13 Mar 2007, It remain as 13 Mar 2007 !!!
> The date format is the same when I use visual studio to launch the web
> application. When I deploy it to IIS, I have encountered the above problem.
> I have changed the web server locale to en-US and my report server is also
> en-US. This makes no difference.
> Could someone help? Thx.
Unfortunately, it sounds like it is a system regional setting issue.
I'm not very savvy in this area; but, have you checked all of the
related regional settings (incl. SQL Server's)? Perhaps another group
member can add a little more insight. Sorry I could not be of greater
assistance.
Regards,
Enrique Martinez
Sr. SQL Server Developer|||Have you tried passing the date in with standard date format
In VB would be CDate("datestring").tostring("s")
On Mar 9, 7:33 am, "EMartinez" <emartinez...@.gmail.com> wrote:
> On Mar 9, 6:13 am, Cloud <C...@.discussions.microsoft.com> wrote:
> > Hi all,
> > In my web service call, I pass the date value to the reporting services in
> > the format of yyyy-MM-dd. But the reporting service interpret the date value
> > in a strange way. When I select 9 Mar 2007, It convert the date to 3 Sep
> > 2007. However, when I select 13 Mar 2007, It remain as 13 Mar 2007 !!!
> > The date format is the same when I use visual studio to launch the web
> > application. When I deploy it to IIS, I have encountered the above problem.
> > I have changed the web server locale to en-US and my report server is also
> > en-US. This makes no difference.
> > Could someone help? Thx.
> Unfortunately, it sounds like it is a system regional setting issue.
> I'm not very savvy in this area; but, have you checked all of the
> related regional settings (incl. SQL Server's)? Perhaps another group
> member can add a little more insight. Sorry I could not be of greater
> assistance.
> Regards,
> Enrique Martinez
> Sr. SQL Server Developer|||Hi All,
I have tried to change the format to "s", the result is still the same.
And I have logged the Soap messages in both cases (Visual Studio and IIS),
the Soap Messages are exactly the same.
Since the messages are same, the ReportService Web Service must get the
locale/dateformot information in other ways. Does anyone know how does the
ReportService Web Service determine the date format of a parameter?|||>Does anyone know how does the
> ReportService Web Service determine the date format of a parameter?
Looking at two versions of the spec they both say:
>>DateTime parameters, use ISO 8601 compatible values.
Docs say the same thing.
Are you sure that you are sending the values with leading 0's as you would
need to? I ask because you say:
>>When I select 9 Mar 2007, It convert the date to 3 Sep 2007. However, when
>>I select 13 Mar 2007, It remain as 13 Mar 2007 !!!
Notice that you are having a problem with the day value that is a single
digit, but not having a problem with the day value that is two digits. Not
sure if this is relevant or not.
Also, when you say "When I select", how exactly are you selecting the value,
what type of control? Just in case...
>L<
"Cloud" <Cloud@.discussions.microsoft.com> wrote in message
news:FF326B56-4D22-4F4B-B6ED-7C787BCF5047@.microsoft.com...
> Hi All,
> I have tried to change the format to "s", the result is still the same.
> And I have logged the Soap messages in both cases (Visual Studio and
> IIS),
> the Soap Messages are exactly the same.
> Since the messages are same, the ReportService Web Service must get the
> locale/dateformot information in other ways.

Friday, March 23, 2012

ReportServer Service Issue

We have multiple reports that are rendered in pdf format and delivered using
the email extension. We have started experiencing a rendering error that
stops the reports form rendering/delivery and only seems to be fixed after
restarting the ReportServer service. Could this be a timing issue? We have
multiple reports kicking off at the same time that render in pdf format. Any
help would be greatly appreciated.
Thanks,
SteveThe first thing to do is to go to the Logs for Report Server, generally under
MSSQL.3 directory of your install... Look there for clues...
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
I support the Professional Association for SQL Server ( PASS) and it''s
community of SQL Professionals.
"Steve Bennett" wrote:
> We have multiple reports that are rendered in pdf format and delivered using
> the email extension. We have started experiencing a rendering error that
> stops the reports form rendering/delivery and only seems to be fixed after
> restarting the ReportServer service. Could this be a timing issue? We have
> multiple reports kicking off at the same time that render in pdf format. Any
> help would be greatly appreciated.
> Thanks,
> Steve
>
>|||This is the first exception in the log file, a generic GDI+ error and then
it cascades from there...
ReportingServicesService!reportrendering!524!01/30/2006-04:00:13:: e ERROR:
Throwing
Microsoft.ReportingServices.ReportProcessing.WrapperReportRenderingException:
Exception of type
Microsoft.ReportingServices.ReportRendering.ReportRenderingException was
thrown., ;
Info:
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.Runtime.InteropServices.ExternalException: A generic
error occurred in GDI+.
at System.Drawing.Graphics.MeasureString(String text, Font font, SizeF
layoutArea, StringFormat stringFormat)
at
Microsoft.ReportingServices.Rendering.ImageRenderer.CanvasFont.LineHeight(Graphics
graphics, SizeF maxSizeF)
at
Microsoft.ReportingServices.Rendering.ImageRenderer.CanvasBase.LineHeight(CanvasFont
font)
at
Microsoft.ReportingServices.Rendering.ImageRenderer.TextBox.CalculateItemMeasurement(Orientation
orientation)
at
Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItem.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.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.ImageReport.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 --
ReportingServicesService!library!524!01/30/2006-04:00:13:: i INFO:
Initializing EnableExecutionLogging to 'True' as specified in Server system
properties.
ReportingServicesService!notification!524!01/30/2006-04:00:13:: Notification
4a595bbc-4073-48ac-ac3c-e39b1aa50018 completed. Success: False, Status:
Exception of type
Microsoft.ReportingServices.ReportRendering.ReportRenderingException was
thrown., DeliveryExtension: Printer Delivery Sample, Report: TMP
ExceptionConformance Report, Attempt 1
ReportingServicesService!dbpolling!524!01/30/2006-04:00:13::
NotificationPolling finished processing item
4a595bbc-4073-48ac-ac3c-e39b1aa50018
ReportingServicesService!reportrendering!1210!01/30/2006-04:00:18:: e ERROR:
Throwing
Microsoft.ReportingServices.ReportProcessing.WrapperReportRenderingException:
Exception of type
Microsoft.ReportingServices.ReportRendering.ReportRenderingException was
thrown., ;
Info:
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.Runtime.InteropServices.ExternalException: A generic
error occurred in GDI+.
at System.Drawing.Graphics.MeasureString(String text, Font font, SizeF
layoutArea, StringFormat stringFormat)
at
Microsoft.ReportingServices.Rendering.ImageRenderer.CanvasFont.LineHeight(Graphics
graphics, SizeF maxSizeF)
at
Microsoft.ReportingServices.Rendering.ImageRenderer.CanvasBase.LineHeight(CanvasFont
font)
at
Microsoft.ReportingServices.Rendering.ImageRenderer.TextBox.CalculateItemMeasurement(Orientation
orientation)
at
Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItem.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.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.ImageReport.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 --
ReportingServicesService!library!1210!01/30/2006-04:00:18:: i INFO:
Initializing EnableExecutionLogging to 'True' as specified in Server system
properties.
ReportingServicesService!notification!1210!01/30/2006-04:00:18::
Notification d1ffd955-b678-4a68-83d2-dddfffa5fe9e completed. Success:
False, Status: Exception of type
Microsoft.ReportingServices.ReportRendering.ReportRenderingException was
thrown., DeliveryExtension: Printer Delivery Sample, Report: GWD
ExceptionConformance Report, Attempt 1
Sorry, the first reply went to the wrong message...
"Wayne Snyder" <wayne.nospam.snyder@.mariner-usa.com> wrote in message
news:687E1061-75DB-400E-BB7A-5975FE043A9B@.microsoft.com...
> The first thing to do is to go to the Logs for Report Server, generally
> under
> MSSQL.3 directory of your install... Look there for clues...
>
> --
> Wayne Snyder MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> I support the Professional Association for SQL Server ( PASS) and it''s
> community of SQL Professionals.
>
> "Steve Bennett" wrote:
>> We have multiple reports that are rendered in pdf format and delivered
>> using
>> the email extension. We have started experiencing a rendering error that
>> stops the reports form rendering/delivery and only seems to be fixed
>> after
>> restarting the ReportServer service. Could this be a timing issue? We
>> have
>> multiple reports kicking off at the same time that render in pdf format.
>> Any
>> help would be greatly appreciated.
>> Thanks,
>> Steve
>>

Monday, March 12, 2012

Reports exported as Excel cannot be read by Mac version of Excel

I searched the list but did not see anything related.

I cannot open a file directly exported from RS in the Excel format. If I open the file in the Windows version and then close it, no need to even save it, I can then open it with the Mac version of Excel. The file size after closing is about 2K less so the RS program is adding something onto the file that the Mac version does not like. It will crash Excel when trying to open.

I cannot export the report as CSV as it will not correctly import into Excel on the Mac.

Is there a work around for this?

Thanks.

--seani have the exact same problem. the excel files open on windows fine, but on the mac they crash excel. if you start excel and then use file-> open, it just hangs.|||

I am also having this problem with users trying to open the xlm file created from RS and using a MAC. Please let us know what is causing this problem and how to correct it.

I will note the spreadsheet did open for the user when they used EXCEL 98, but doesn't work with EXCEL 2001 or EXCEL 2004.

I found this http://support.microsoft.com/kb/918529 . It fixes 2005 SQL server but I see nothing for SQL server 2000.

Thanks.

|||

Hey, I'm also have this problem, I read that the SP2 of SQL Server 2005 fix this problem, but we are having some problems with SSAS and the SP2, so we can't install it.

Doe's any one installed the fix mentioned in the post above? ... Any troubles? ... Thanks!

|||We installed SP2 and low and behold the problem is gone. Our MAC users are very happy.

Thanks.

--sean

Reports exported as Excel cannot be read by Mac version of Excel

I searched the list but did not see anything related.

I cannot open a file directly exported from RS in the Excel format. If I open the file in the Windows version and then close it, no need to even save it, I can then open it with the Mac version of Excel. The file size after closing is about 2K less so the RS program is adding something onto the file that the Mac version does not like. It will crash Excel when trying to open.

I cannot export the report as CSV as it will not correctly import into Excel on the Mac.

Is there a work around for this?

Thanks.

--sean
i have the exact same problem. the excel files open on windows fine, but on the mac they crash excel. if you start excel and then use file-> open, it just hangs.
|||

I am also having this problem with users trying to open the xlm file created from RS and using a MAC. Please let us know what is causing this problem and how to correct it.

I will note the spreadsheet did open for the user when they used EXCEL 98, but doesn't work with EXCEL 2001 or EXCEL 2004.

I found this http://support.microsoft.com/kb/918529 . It fixes 2005 SQL server but I see nothing for SQL server 2000.

Thanks.

|||

Hey, I'm also have this problem, I read that the SP2 of SQL Server 2005 fix this problem, but we are having some problems with SSAS and the SP2, so we can't install it.

Doe's any one installed the fix mentioned in the post above? ... Any troubles? ... Thanks!

|||We installed SP2 and low and behold the problem is gone. Our MAC users are very happy.

Thanks.

--sean

Reports exported as Excel cannot be read by Mac version of Excel

I searched the list but did not see anything related.

I cannot open a file directly exported from RS in the Excel format. If I open the file in the Windows version and then close it, no need to even save it, I can then open it with the Mac version of Excel. The file size after closing is about 2K less so the RS program is adding something onto the file that the Mac version does not like. It will crash Excel when trying to open.

I cannot export the report as CSV as it will not correctly import into Excel on the Mac.

Is there a work around for this?

Thanks.

--seani have the exact same problem. the excel files open on windows fine, but on the mac they crash excel. if you start excel and then use file-> open, it just hangs.|||

I am also having this problem with users trying to open the xlm file created from RS and using a MAC. Please let us know what is causing this problem and how to correct it.

I will note the spreadsheet did open for the user when they used EXCEL 98, but doesn't work with EXCEL 2001 or EXCEL 2004.

I found this http://support.microsoft.com/kb/918529 . It fixes 2005 SQL server but I see nothing for SQL server 2000.

Thanks.

|||

Hey, I'm also have this problem, I read that the SP2 of SQL Server 2005 fix this problem, but we are having some problems with SSAS and the SP2, so we can't install it.

Doe's any one installed the fix mentioned in the post above? ... Any troubles? ... Thanks!

|||We installed SP2 and low and behold the problem is gone. Our MAC users are very happy.

Thanks.

--sean

Reports cannot be exported to csv format

Hi,

We have developed few reports through SQL Server Reporting Service 2005.
All those reports are columnar graphs (BAR charts).
One of the requirement of the project is to have the ability to export the report in different formats.
Since our reports are columnar graphs we are unable to export it to CSV or MHTML format.
Is there are setting in the report, which allows me to display the values, when exported to csv format?
also is there any setting for MHTML format. Some machine open the report in MHTML format and some machine does not.

Any help would be appreciated.

Thanks in advance!

No replies yet:(

The only solution we can think about is to develop those many reports in tabular format. (only for CSV format)

Any other solution available?

Thanks!

|||

CSV output should include Chart Data. http://msdn2.microsoft.com/en-us/library/aa178937(SQL.80).aspx

If you are not getting data, make sure to set DataElementOutput to true. Here is a link to how it works for XML.

http://msdn2.microsoft.com/en-us/library/aa179497(SQL.80).aspx

|||

Even I read the first MSDN link where it mentions charts can be rendered to CSV. Thats why I am a bit sure that there may be some setting in the properties, which will show the data values in CSV.

I also tried the setting mentioned in the CSV Device Information Settings and mentioned Encoding value for CSV as ASCII. Restarted SQL Server.

I also set the DataElementOutput property to "Output" but still I am not able to see the expected result.

Please do let me know if there is any solution available.

Thanks!

|||

Chart Data is supposed to be exported to CSV.

Can you attach the report definition so I can take a look and diagnose the problem?

Thanks!

|||

Hi Denis,

Following is the report definition. Hope to find some solution to my problem.

Thanks in advance!

<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<DataSources>
<DataSource Name="ML_OLAP_DS">
<DataSourceReference>ML_OLAP_DS</DataSourceReference>
<rd:DataSourceID>2e071b5e-2d8d-4aab-94ff-edf8900886a2</rd:DataSourceID>
</DataSource>
</DataSources>
<BottomMargin>1in</BottomMargin>
<RightMargin>1in</RightMargin>
<ReportParameters>
<ReportParameter Name="startDate">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>[DATE].[Startdate].[All]</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>Start Date</Prompt>
</ReportParameter>
<ReportParameter Name="endDate">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>[DATE].[Startdate].[All]</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>End Date</Prompt>
</ReportParameter>
<ReportParameter Name="users">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>[USERS].[WINDOWS LOGON NAME].[All]</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>Users</Prompt>
</ReportParameter>
<ReportParameter Name="appName">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>[APPLICATIONS].[APPLICATION NAME].[All]</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>Applications</Prompt>
</ReportParameter>
<ReportParameter Name="chartTitle">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>Ten Most Used Applications</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>Chart Title</Prompt>
</ReportParameter>
</ReportParameters>
<rd:DrawGrid>true</rd:DrawGrid>
<InteractiveWidth>8.5in</InteractiveWidth>
<rd:SnapToGrid>true</rd:SnapToGrid>
<Body>
<ReportItems>
<Chart Name="MostUsedAppChart">
<Legend>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
<Position>RightCenter</Position>
</Legend>
<Subtype>Plain</Subtype>
<Title>
<Caption>=RTRIM( Parameters!chartTitle.Value)</Caption>
<Style>
<FontFamily>Arial Black</FontFamily>
</Style>
</Title>
<NoRows>The current report criteria does not satisfy any records.</NoRows>
<Height>6.125in</Height>
<CategoryAxis>
<Axis>
<Title>
<Caption>Applications</Caption>
<Style>
<FontFamily>Arial Black</FontFamily>
</Style>
</Title>
<MajorGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MajorGridLines>
<MinorGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MinorGridLines>
<MajorTickMarks>Outside</MajorTickMarks>
<Min>0</Min>
<Visible>true</Visible>
</Axis>
</CategoryAxis>
<PointWidth>0</PointWidth>
<Left>0.125in</Left>
<ThreeDProperties>
<Rotation>30</Rotation>
<Inclination>30</Inclination>
<Shading>Simple</Shading>
<WallThickness>50</WallThickness>
</ThreeDProperties>
<DataSetName>MostUsedAppDS</DataSetName>
<SeriesGroupings>
<SeriesGrouping>
<StaticSeries>
<StaticMember>
<Label>Value1</Label>
</StaticMember>
</StaticSeries>
</SeriesGrouping>
</SeriesGroupings>
<PlotArea>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<BackgroundColor>LightGrey</BackgroundColor>
</Style>
</PlotArea>
<ValueAxis>
<Axis>
<Title>
<Caption>Occurences</Caption>
<Style>
<FontFamily>Arial Black</FontFamily>
</Style>
</Title>
<MajorGridLines>
<ShowGridLines>true</ShowGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MajorGridLines>
<MinorGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MinorGridLines>
<MajorTickMarks>Outside</MajorTickMarks>
<Min>0</Min>
<Margin>true</Margin>
<Visible>true</Visible>
<Scalar>true</Scalar>
</Axis>
</ValueAxis>
<Type>Column</Type>
<Width>4.5375in</Width>
<CategoryGroupings>
<CategoryGrouping>
<DynamicCategories>
<Grouping Name="chart1_CategoryGroup1">
<GroupExpressions>
<GroupExpression>=Fields!APPLICATION_NAME.Value</GroupExpression>
</GroupExpressions>
</Grouping>
<Label />
</DynamicCategories>
</CategoryGrouping>
</CategoryGroupings>
<Palette>Default</Palette>
<ChartData>
<ChartSeries>
<DataPoints>
<DataPoint>
<DataValues>
<DataValue>
<Value>=Sum(Fields!APPLICATION_INSTANCES_VIEW_Count.Value)</Value>
</DataValue>
</DataValues>
<DataLabel>
<Style>
<FontSize>8pt</FontSize>
</Style>
<Value>=Fields!APPLICATION_INSTANCES_VIEW_Count.Value</Value>
<Visible>true</Visible>
</DataLabel>
<Marker>
<Size>6pt</Size>
</Marker>
</DataPoint>
</DataPoints>
</ChartSeries>
</ChartData>
<Style>
<BackgroundColor>White</BackgroundColor>
</Style>
</Chart>
</ReportItems>
<Height>7.875in</Height>
</Body>
<rd:ReportID>a7bd15d4-cace-4fe8-b2d3-62bc6fc786a8</rd:ReportID>
<LeftMargin>1in</LeftMargin>
<DataSets>
<DataSet Name="MostUsedAppDS">
<Query>
<rd:SuppressAutoUpdate>true</rd:SuppressAutoUpdate>
<CommandText>WITH
MEMBER [DATE].[StartDate].[DateRange] AS
AGGREGATE
( STRTOMEMBER(@.startDate) : STRTOMEMBER(@.endDate), [Measures].CURRENTMEMBER
)
MEMBER [USERS].[WINDOWS LOGON NAME].[UserName] AS
AGGREGATE
( {STRTOSET(@.users)} )
SELECT
NON EMPTY { [Measures].[APPLICATION INSTANCES VIEW Count] } ON COLUMNS,
NON EMPTY TopCount ( Filter ( {[APPLICATIONS].[APPLICATION NAME].[APPLICATION NAME]}, [Measures].[APPLICATION INSTANCES VIEW Count] &gt;= 0 ) , 10, [Measures].[APPLICATION INSTANCES VIEW Count] ) ON ROWS
FROM
(select STRTOSET(@.appName) on 0 from [ApplicationUsage] )
WHERE
(([USERS].[WINDOWS LOGON NAME].[UserName]),[DATE].[StartDate].[DateRange])</CommandText>
<QueryParameters>
<QueryParameter Name="startDate">
<Value>=Parameters!startDate.Value</Value>
</QueryParameter>
<QueryParameter Name="endDate">
<Value>=Parameters!endDate.Value</Value>
</QueryParameter>
<QueryParameter Name="users">
<Value>=Parameters!users.Value</Value>
</QueryParameter>
<QueryParameter Name="appName">
<Value>=Parameters!appName.Value</Value>
</QueryParameter>
<QueryParameter Name="chartTitle">
<Value>=Parameters!chartTitle.Value</Value>
</QueryParameter>
</QueryParameters>
<DataSourceName>ML_OLAP_DS</DataSourceName>
<rd:MdxQuery><QueryDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/AnalysisServices/QueryDefinition"><CommandType>MDX</CommandType><Type>Query</Type><QuerySpecification xsi:type="MDXQuerySpecification"><Select><Items><Item><ID xsi:type="Level"><DimensionName>APPLICATIONS</DimensionName><HierarchyName>APPLICATION NAME</HierarchyName><HierarchyUniqueName>[APPLICATIONS].[APPLICATION NAME]</HierarchyUniqueName><LevelName>APPLICATION NAME</LevelName><UniqueName>[APPLICATIONS].[APPLICATION NAME].[APPLICATION NAME]</UniqueName></ID><ItemCaption>APPLICATION NAME</ItemCaption></Item><Item><ID xsi:type="Measure"><MeasureName>APPLICATION INSTANCES VIEW Count</MeasureName><UniqueName>[Measures].[APPLICATION INSTANCES VIEW Count]</UniqueName></ID><ItemCaption>APPLICATION INSTANCES VIEW Count</ItemCaption><FormattedValue>true</FormattedValue></Item></Items></Select><From>ApplicationUsage</From><Filter><FilterItems /></Filter><Calculations /><Aggregates /><QueryProperties /></QuerySpecification><Query><Statement>WITH
MEMBER [DATE].[StartDate].[DateRange] AS
AGGREGATE
( STRTOMEMBER(@.startDate) : STRTOMEMBER(@.endDate), [Measures].CURRENTMEMBER
)
MEMBER [USERS].[WINDOWS LOGON NAME].[UserName] AS
AGGREGATE
( {STRTOSET(@.users)} )
SELECT
NON EMPTY { [Measures].[APPLICATION INSTANCES VIEW Count] } ON COLUMNS,
NON EMPTY TopCount ( Filter ( {[APPLICATIONS].[APPLICATION NAME].[APPLICATION NAME]}, [Measures].[APPLICATION INSTANCES VIEW Count] &gt;= 0 ) , 10, [Measures].[APPLICATION INSTANCES VIEW Count] ) ON ROWS
FROM
(select STRTOSET(@.appName) on 0 from [ApplicationUsage] )
WHERE
(([USERS].[WINDOWS LOGON NAME].[UserName]),[DATE].[StartDate].[DateRange])</Statement><ParameterDefinitions><ParameterDefinition><Name>startDate</Name><DefaultValues><DefaultValue>[DATE].[Startdate].[All]</DefaultValue></DefaultValues><Caption>startDate</Caption><HierarchyUniqueName>[DATE].[Startdate]</HierarchyUniqueName><ParameterValuesQuery><Statement>WITH MEMBER [Measures].[ParameterCaption] AS '[DATE].[Startdate].CURRENTMEMBER.MEMBER_CAPTION' MEMBER [Measures].[ParameterValue] AS '[DATE].[Startdate].CURRENTMEMBER.UNIQUENAME' MEMBER [Measures].[ParameterLevel] AS '[DATE].[Startdate].CURRENTMEMBER.LEVEL.ORDINAL' SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS , [DATE].[Startdate].ALLMEMBERS ON ROWS FROM [ApplicationUsage]</Statement><ParameterizedStatement><ReferencedParameters /></ParameterizedStatement></ParameterValuesQuery></ParameterDefinition><ParameterDefinition><Name>endDate</Name><DefaultValues><DefaultValue>[DATE].[Startdate].[All]</DefaultValue></DefaultValues><Caption>endDate</Caption><HierarchyUniqueName>[DATE].[Startdate]</HierarchyUniqueName><ParameterValuesQuery><Statement>WITH MEMBER [Measures].[ParameterCaption] AS '[DATE].[Startdate].CURRENTMEMBER.MEMBER_CAPTION' MEMBER [Measures].[ParameterValue] AS '[DATE].[Startdate].CURRENTMEMBER.UNIQUENAME' MEMBER [Measures].[ParameterLevel] AS '[DATE].[Startdate].CURRENTMEMBER.LEVEL.ORDINAL' SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS , [DATE].[Startdate].ALLMEMBERS ON ROWS FROM [ApplicationUsage]</Statement><ParameterizedStatement><ReferencedParameters /></ParameterizedStatement></ParameterValuesQuery></ParameterDefinition><ParameterDefinition><Name>users</Name><DefaultValues><DefaultValue>[USERS].[WINDOWS LOGON NAME].[All]</DefaultValue></DefaultValues><Caption>users</Caption><HierarchyUniqueName>[USERS].[WINDOWS LOGON NAME]</HierarchyUniqueName><ParameterValuesQuery><Statement>WITH MEMBER [Measures].[ParameterCaption] AS '[USERS].[WINDOWS LOGON NAME].CURRENTMEMBER.MEMBER_CAPTION' MEMBER [Measures].[ParameterValue] AS '[USERS].[WINDOWS LOGON NAME].CURRENTMEMBER.UNIQUENAME' MEMBER [Measures].[ParameterLevel] AS '[USERS].[WINDOWS LOGON NAME].CURRENTMEMBER.LEVEL.ORDINAL' SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS , [USERS].[WINDOWS LOGON NAME].ALLMEMBERS ON ROWS FROM [ApplicationUsage]</Statement><ParameterizedStatement><ReferencedParameters /></ParameterizedStatement></ParameterValuesQuery></ParameterDefinition><ParameterDefinition><Name>appName</Name><DefaultValues><DefaultValue>[APPLICATIONS].[APPLICATION NAME].[All]</DefaultValue></DefaultValues><Caption>appName</Caption><HierarchyUniqueName>[APPLICATIONS].[APPLICATION NAME]</HierarchyUniqueName><ParameterValuesQuery><Statement>WITH MEMBER [Measures].[ParameterCaption] AS '[APPLICATIONS].[APPLICATION NAME].CURRENTMEMBER.MEMBER_CAPTION' MEMBER [Measures].[ParameterValue] AS '[APPLICATIONS].[APPLICATION NAME].CURRENTMEMBER.UNIQUENAME' MEMBER [Measures].[ParameterLevel] AS '[APPLICATIONS].[APPLICATION NAME].CURRENTMEMBER.LEVEL.ORDINAL' SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS , [APPLICATIONS].[APPLICATION NAME].ALLMEMBERS ON ROWS FROM [ApplicationUsage]</Statement><ParameterizedStatement><ReferencedParameters /></ParameterizedStatement></ParameterValuesQuery></ParameterDefinition><ParameterDefinition><Name>chartTitle</Name><DefaultValues><DefaultValue>Ten Most Used Applications</DefaultValue></DefaultValues><Caption>chartTitle</Caption><ParameterValuesQuery><ParameterizedStatement><ReferencedParameters /></ParameterizedStatement></ParameterValuesQuery></ParameterDefinition></ParameterDefinitions></Query></QueryDefinition></rd:MdxQuery>
</Query>
<Fields>
<Field Name="APPLICATION_NAME">
<rd:TypeName>System.String</rd:TypeName>
<DataField>&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;Field xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="Level" UniqueName="[APPLICATIONS].[APPLICATION NAME].[APPLICATION NAME]" /&gt;</DataField>
</Field>
<Field Name="APPLICATION_INSTANCES_VIEW_Count">
<rd:TypeName>System.Int32</rd:TypeName>
<DataField>&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;Field xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="Measure" UniqueName="[Measures].[APPLICATION INSTANCES VIEW Count]" /&gt;</DataField>
</Field>
</Fields>
</DataSet>
</DataSets>
<Width>4.75in</Width>
<InteractiveHeight>11in</InteractiveHeight>
<Language>en-US</Language>
<TopMargin>1in</TopMargin>
</Report>

|||No luck yet?|||

It appears to be an error in Books Online: CSV renderer does not render chart data, while XML renderer does. Sorry about confusion.

One way you can export chart data is by applying XSL transformation to the XML data output of the report:

http://msdn2.microsoft.com/en-us/library/aa178953(SQL.80).aspx

Reports cannot be exported to csv format

Hi,

We have developed few reports through SQL Server Reporting Service 2005.
All those reports are columnar graphs (BAR charts).
One of the requirement of the project is to have the ability to export the report in different formats.
Since our reports are columnar graphs we are unable to export it to CSV or MHTML format.
Is there are setting in the report, which allows me to display the values, when exported to csv format?
also is there any setting for MHTML format. Some machine open the report in MHTML format and some machine does not.

Any help would be appreciated.

Thanks in advance!

No replies yet:(

The only solution we can think about is to develop those many reports in tabular format. (only for CSV format)

Any other solution available?

Thanks!

|||

CSV output should include Chart Data. http://msdn2.microsoft.com/en-us/library/aa178937(SQL.80).aspx

If you are not getting data, make sure to set DataElementOutput to true. Here is a link to how it works for XML.

http://msdn2.microsoft.com/en-us/library/aa179497(SQL.80).aspx

|||

Even I read the first MSDN link where it mentions charts can be rendered to CSV. Thats why I am a bit sure that there may be some setting in the properties, which will show the data values in CSV.

I also tried the setting mentioned in the CSV Device Information Settings and mentioned Encoding value for CSV as ASCII. Restarted SQL Server.

I also set the DataElementOutput property to "Output" but still I am not able to see the expected result.

Please do let me know if there is any solution available.

Thanks!

|||

Chart Data is supposed to be exported to CSV.

Can you attach the report definition so I can take a look and diagnose the problem?

Thanks!

|||

Hi Denis,

Following is the report definition. Hope to find some solution to my problem.

Thanks in advance!

<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<DataSources>
<DataSource Name="ML_OLAP_DS">
<DataSourceReference>ML_OLAP_DS</DataSourceReference>
<rd:DataSourceID>2e071b5e-2d8d-4aab-94ff-edf8900886a2</rd:DataSourceID>
</DataSource>
</DataSources>
<BottomMargin>1in</BottomMargin>
<RightMargin>1in</RightMargin>
<ReportParameters>
<ReportParameter Name="startDate">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>[DATE].[Startdate].[All]</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>Start Date</Prompt>
</ReportParameter>
<ReportParameter Name="endDate">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>[DATE].[Startdate].[All]</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>End Date</Prompt>
</ReportParameter>
<ReportParameter Name="users">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>[USERS].[WINDOWS LOGON NAME].[All]</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>Users</Prompt>
</ReportParameter>
<ReportParameter Name="appName">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>[APPLICATIONS].[APPLICATION NAME].[All]</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>Applications</Prompt>
</ReportParameter>
<ReportParameter Name="chartTitle">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>Ten Most Used Applications</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>Chart Title</Prompt>
</ReportParameter>
</ReportParameters>
<rd:DrawGrid>true</rd:DrawGrid>
<InteractiveWidth>8.5in</InteractiveWidth>
<rd:SnapToGrid>true</rd:SnapToGrid>
<Body>
<ReportItems>
<Chart Name="MostUsedAppChart">
<Legend>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
<Position>RightCenter</Position>
</Legend>
<Subtype>Plain</Subtype>
<Title>
<Caption>=RTRIM( Parameters!chartTitle.Value)</Caption>
<Style>
<FontFamily>Arial Black</FontFamily>
</Style>
</Title>
<NoRows>The current report criteria does not satisfy any records.</NoRows>
<Height>6.125in</Height>
<CategoryAxis>
<Axis>
<Title>
<Caption>Applications</Caption>
<Style>
<FontFamily>Arial Black</FontFamily>
</Style>
</Title>
<MajorGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MajorGridLines>
<MinorGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MinorGridLines>
<MajorTickMarks>Outside</MajorTickMarks>
<Min>0</Min>
<Visible>true</Visible>
</Axis>
</CategoryAxis>
<PointWidth>0</PointWidth>
<Left>0.125in</Left>
<ThreeDProperties>
<Rotation>30</Rotation>
<Inclination>30</Inclination>
<Shading>Simple</Shading>
<WallThickness>50</WallThickness>
</ThreeDProperties>
<DataSetName>MostUsedAppDS</DataSetName>
<SeriesGroupings>
<SeriesGrouping>
<StaticSeries>
<StaticMember>
<Label>Value1</Label>
</StaticMember>
</StaticSeries>
</SeriesGrouping>
</SeriesGroupings>
<PlotArea>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<BackgroundColor>LightGrey</BackgroundColor>
</Style>
</PlotArea>
<ValueAxis>
<Axis>
<Title>
<Caption>Occurences</Caption>
<Style>
<FontFamily>Arial Black</FontFamily>
</Style>
</Title>
<MajorGridLines>
<ShowGridLines>true</ShowGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MajorGridLines>
<MinorGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MinorGridLines>
<MajorTickMarks>Outside</MajorTickMarks>
<Min>0</Min>
<Margin>true</Margin>
<Visible>true</Visible>
<Scalar>true</Scalar>
</Axis>
</ValueAxis>
<Type>Column</Type>
<Width>4.5375in</Width>
<CategoryGroupings>
<CategoryGrouping>
<DynamicCategories>
<Grouping Name="chart1_CategoryGroup1">
<GroupExpressions>
<GroupExpression>=Fields!APPLICATION_NAME.Value</GroupExpression>
</GroupExpressions>
</Grouping>
<Label />
</DynamicCategories>
</CategoryGrouping>
</CategoryGroupings>
<Palette>Default</Palette>
<ChartData>
<ChartSeries>
<DataPoints>
<DataPoint>
<DataValues>
<DataValue>
<Value>=Sum(Fields!APPLICATION_INSTANCES_VIEW_Count.Value)</Value>
</DataValue>
</DataValues>
<DataLabel>
<Style>
<FontSize>8pt</FontSize>
</Style>
<Value>=Fields!APPLICATION_INSTANCES_VIEW_Count.Value</Value>
<Visible>true</Visible>
</DataLabel>
<Marker>
<Size>6pt</Size>
</Marker>
</DataPoint>
</DataPoints>
</ChartSeries>
</ChartData>
<Style>
<BackgroundColor>White</BackgroundColor>
</Style>
</Chart>
</ReportItems>
<Height>7.875in</Height>
</Body>
<rd:ReportID>a7bd15d4-cace-4fe8-b2d3-62bc6fc786a8</rd:ReportID>
<LeftMargin>1in</LeftMargin>
<DataSets>
<DataSet Name="MostUsedAppDS">
<Query>
<rd:SuppressAutoUpdate>true</rd:SuppressAutoUpdate>
<CommandText>WITH
MEMBER [DATE].[StartDate].[DateRange] AS
AGGREGATE
( STRTOMEMBER(@.startDate) : STRTOMEMBER(@.endDate), [Measures].CURRENTMEMBER
)
MEMBER [USERS].[WINDOWS LOGON NAME].[UserName] AS
AGGREGATE
( {STRTOSET(@.users)} )
SELECT
NON EMPTY { [Measures].[APPLICATION INSTANCES VIEW Count] } ON COLUMNS,
NON EMPTY TopCount ( Filter ( {[APPLICATIONS].[APPLICATION NAME].[APPLICATION NAME]}, [Measures].[APPLICATION INSTANCES VIEW Count] &gt;= 0 ) , 10, [Measures].[APPLICATION INSTANCES VIEW Count] ) ON ROWS
FROM
(select STRTOSET(@.appName) on 0 from [ApplicationUsage] )
WHERE
(([USERS].[WINDOWS LOGON NAME].[UserName]),[DATE].[StartDate].[DateRange])</CommandText>
<QueryParameters>
<QueryParameter Name="startDate">
<Value>=Parameters!startDate.Value</Value>
</QueryParameter>
<QueryParameter Name="endDate">
<Value>=Parameters!endDate.Value</Value>
</QueryParameter>
<QueryParameter Name="users">
<Value>=Parameters!users.Value</Value>
</QueryParameter>
<QueryParameter Name="appName">
<Value>=Parameters!appName.Value</Value>
</QueryParameter>
<QueryParameter Name="chartTitle">
<Value>=Parameters!chartTitle.Value</Value>
</QueryParameter>
</QueryParameters>
<DataSourceName>ML_OLAP_DS</DataSourceName>
<rd:MdxQuery><QueryDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/AnalysisServices/QueryDefinition"><CommandType>MDX</CommandType><Type>Query</Type><QuerySpecification xsi:type="MDXQuerySpecification"><Select><Items><Item><ID xsi:type="Level"><DimensionName>APPLICATIONS</DimensionName><HierarchyName>APPLICATION NAME</HierarchyName><HierarchyUniqueName>[APPLICATIONS].[APPLICATION NAME]</HierarchyUniqueName><LevelName>APPLICATION NAME</LevelName><UniqueName>[APPLICATIONS].[APPLICATION NAME].[APPLICATION NAME]</UniqueName></ID><ItemCaption>APPLICATION NAME</ItemCaption></Item><Item><ID xsi:type="Measure"><MeasureName>APPLICATION INSTANCES VIEW Count</MeasureName><UniqueName>[Measures].[APPLICATION INSTANCES VIEW Count]</UniqueName></ID><ItemCaption>APPLICATION INSTANCES VIEW Count</ItemCaption><FormattedValue>true</FormattedValue></Item></Items></Select><From>ApplicationUsage</From><Filter><FilterItems /></Filter><Calculations /><Aggregates /><QueryProperties /></QuerySpecification><Query><Statement>WITH
MEMBER [DATE].[StartDate].[DateRange] AS
AGGREGATE
( STRTOMEMBER(@.startDate) : STRTOMEMBER(@.endDate), [Measures].CURRENTMEMBER
)
MEMBER [USERS].[WINDOWS LOGON NAME].[UserName] AS
AGGREGATE
( {STRTOSET(@.users)} )
SELECT
NON EMPTY { [Measures].[APPLICATION INSTANCES VIEW Count] } ON COLUMNS,
NON EMPTY TopCount ( Filter ( {[APPLICATIONS].[APPLICATION NAME].[APPLICATION NAME]}, [Measures].[APPLICATION INSTANCES VIEW Count] &gt;= 0 ) , 10, [Measures].[APPLICATION INSTANCES VIEW Count] ) ON ROWS
FROM
(select STRTOSET(@.appName) on 0 from [ApplicationUsage] )
WHERE
(([USERS].[WINDOWS LOGON NAME].[UserName]),[DATE].[StartDate].[DateRange])</Statement><ParameterDefinitions><ParameterDefinition><Name>startDate</Name><DefaultValues><DefaultValue>[DATE].[Startdate].[All]</DefaultValue></DefaultValues><Caption>startDate</Caption><HierarchyUniqueName>[DATE].[Startdate]</HierarchyUniqueName><ParameterValuesQuery><Statement>WITH MEMBER [Measures].[ParameterCaption] AS '[DATE].[Startdate].CURRENTMEMBER.MEMBER_CAPTION' MEMBER [Measures].[ParameterValue] AS '[DATE].[Startdate].CURRENTMEMBER.UNIQUENAME' MEMBER [Measures].[ParameterLevel] AS '[DATE].[Startdate].CURRENTMEMBER.LEVEL.ORDINAL' SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS , [DATE].[Startdate].ALLMEMBERS ON ROWS FROM [ApplicationUsage]</Statement><ParameterizedStatement><ReferencedParameters /></ParameterizedStatement></ParameterValuesQuery></ParameterDefinition><ParameterDefinition><Name>endDate</Name><DefaultValues><DefaultValue>[DATE].[Startdate].[All]</DefaultValue></DefaultValues><Caption>endDate</Caption><HierarchyUniqueName>[DATE].[Startdate]</HierarchyUniqueName><ParameterValuesQuery><Statement>WITH MEMBER [Measures].[ParameterCaption] AS '[DATE].[Startdate].CURRENTMEMBER.MEMBER_CAPTION' MEMBER [Measures].[ParameterValue] AS '[DATE].[Startdate].CURRENTMEMBER.UNIQUENAME' MEMBER [Measures].[ParameterLevel] AS '[DATE].[Startdate].CURRENTMEMBER.LEVEL.ORDINAL' SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS , [DATE].[Startdate].ALLMEMBERS ON ROWS FROM [ApplicationUsage]</Statement><ParameterizedStatement><ReferencedParameters /></ParameterizedStatement></ParameterValuesQuery></ParameterDefinition><ParameterDefinition><Name>users</Name><DefaultValues><DefaultValue>[USERS].[WINDOWS LOGON NAME].[All]</DefaultValue></DefaultValues><Caption>users</Caption><HierarchyUniqueName>[USERS].[WINDOWS LOGON NAME]</HierarchyUniqueName><ParameterValuesQuery><Statement>WITH MEMBER [Measures].[ParameterCaption] AS '[USERS].[WINDOWS LOGON NAME].CURRENTMEMBER.MEMBER_CAPTION' MEMBER [Measures].[ParameterValue] AS '[USERS].[WINDOWS LOGON NAME].CURRENTMEMBER.UNIQUENAME' MEMBER [Measures].[ParameterLevel] AS '[USERS].[WINDOWS LOGON NAME].CURRENTMEMBER.LEVEL.ORDINAL' SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS , [USERS].[WINDOWS LOGON NAME].ALLMEMBERS ON ROWS FROM [ApplicationUsage]</Statement><ParameterizedStatement><ReferencedParameters /></ParameterizedStatement></ParameterValuesQuery></ParameterDefinition><ParameterDefinition><Name>appName</Name><DefaultValues><DefaultValue>[APPLICATIONS].[APPLICATION NAME].[All]</DefaultValue></DefaultValues><Caption>appName</Caption><HierarchyUniqueName>[APPLICATIONS].[APPLICATION NAME]</HierarchyUniqueName><ParameterValuesQuery><Statement>WITH MEMBER [Measures].[ParameterCaption] AS '[APPLICATIONS].[APPLICATION NAME].CURRENTMEMBER.MEMBER_CAPTION' MEMBER [Measures].[ParameterValue] AS '[APPLICATIONS].[APPLICATION NAME].CURRENTMEMBER.UNIQUENAME' MEMBER [Measures].[ParameterLevel] AS '[APPLICATIONS].[APPLICATION NAME].CURRENTMEMBER.LEVEL.ORDINAL' SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS , [APPLICATIONS].[APPLICATION NAME].ALLMEMBERS ON ROWS FROM [ApplicationUsage]</Statement><ParameterizedStatement><ReferencedParameters /></ParameterizedStatement></ParameterValuesQuery></ParameterDefinition><ParameterDefinition><Name>chartTitle</Name><DefaultValues><DefaultValue>Ten Most Used Applications</DefaultValue></DefaultValues><Caption>chartTitle</Caption><ParameterValuesQuery><ParameterizedStatement><ReferencedParameters /></ParameterizedStatement></ParameterValuesQuery></ParameterDefinition></ParameterDefinitions></Query></QueryDefinition></rd:MdxQuery>
</Query>
<Fields>
<Field Name="APPLICATION_NAME">
<rd:TypeName>System.String</rd:TypeName>
<DataField>&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;Field xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="Level" UniqueName="[APPLICATIONS].[APPLICATION NAME].[APPLICATION NAME]" /&gt;</DataField>
</Field>
<Field Name="APPLICATION_INSTANCES_VIEW_Count">
<rd:TypeName>System.Int32</rd:TypeName>
<DataField>&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;Field xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="Measure" UniqueName="[Measures].[APPLICATION INSTANCES VIEW Count]" /&gt;</DataField>
</Field>
</Fields>
</DataSet>
</DataSets>
<Width>4.75in</Width>
<InteractiveHeight>11in</InteractiveHeight>
<Language>en-US</Language>
<TopMargin>1in</TopMargin>
</Report>

|||No luck yet?|||

It appears to be an error in Books Online: CSV renderer does not render chart data, while XML renderer does. Sorry about confusion.

One way you can export chart data is by applying XSL transformation to the XML data output of the report:

http://msdn2.microsoft.com/en-us/library/aa178953(SQL.80).aspx

Wednesday, March 7, 2012

ReportingService.Render(CSV)

I am calling a reporting service proxy's Render Method passing "CSV" as the format.
Dim result As Byte() = ReportingService.Render("/SomeRPT", "CSV", ...)
Return Text.Encoding.Unicode.GetString(result)
This returns a unicode byte array. This array has four leading bytes (255,254,83,0) that do not belong in the output. If I use the GetString method all of the null chars are stripped out, but this leaves three leading bytes (255,254,83) that do not exist if I call the same report from a web page, and then save as CSV. If I render this report with html, excel, or pdf as a format, the output is as expected.

Is this a bug in the SQL Report Services, Web Service?
Or am I doing something wrong?

Regards,
Ken

Check out MimeType of the result, is it UTF-8? 0xFF and 0xFE are Unicode byte order marks. Save your byte array to a file on disk and open it in the notepad, you shouldn't see any unexpected characters. Alternatively, open StreamReader on it, I think StreamReader recognizes byte order marks.

ReportingService.Render ignores the ColorDepth in TIFF Images

I use ReportingService.Render to get a stream of my report. I use TIFF format
and then I save it to a file.
According to this page
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsprog/htm/rsp_prog_soapapi_dev_9xip.asp
you can determine the color depth of the report image if you use the TIFF
format.
My code is like this:
rs.Render(ReportName, "IMAGE", Nothing,
"<DeviceInfo><OutputFormat>TIFF</OutputFormat><DpiX>300</DpiX><DpiY>300</DpiY><ColorDepth>8</ColorDepth></DeviceInfo>", _
tmpParams, Nothing, Nothing, Nothing, Nothing, Nothing,
Nothing, Nothing)
My tif image is always 24 bit, no matter what I put in ColorDepth (higher or
lower).
Do you know how to fix it, or do you know a quick way to change the pixel
format of a file?
ThanksAmiram,
I don't have a KB article or anything, but MSFT staff have reported that
this is a known bug. Unfortunately, it did not get fixed in SP2, and last I
heard it did not make the cut for RS 2005 either.
I wrote code to loop over the pixels and convert the color depth to
monochrome, but it was too slow. It took about 3 seconds for a 600 x 800
TIFF, which was too long to do synchronously while the user waited. If you
want a color depth that does not require a palette, you can convert it very
quickly in code. However, I have failed to find any way to convert to
monochrome (with palette) without looping over the pixels. Because our
requirements allowed it, we ended up saving the 24 bpp TIFF files to disk and
using a utility to batch convert them once every few minutes.
HTH,
Ted
"Amiram Korach" wrote:
> My tif image is always 24 bit, no matter what I put in ColorDepth (higher or
> lower).
> Do you know how to fix it, or do you know a quick way to change the pixel
> format of a file?|||Thanks a lot.
I don't care to wait three seconds, because all process is in another
thread. Batch is too difficult for me, since I need to install it in each
client machine. Can you show some code for looping over the pixels? My tiff
file usually contains some frames.
Thanks
"Ted K" wrote:
> Amiram,
> I don't have a KB article or anything, but MSFT staff have reported that
> this is a known bug. Unfortunately, it did not get fixed in SP2, and last I
> heard it did not make the cut for RS 2005 either.
> I wrote code to loop over the pixels and convert the color depth to
> monochrome, but it was too slow. It took about 3 seconds for a 600 x 800
> TIFF, which was too long to do synchronously while the user waited. If you
> want a color depth that does not require a palette, you can convert it very
> quickly in code. However, I have failed to find any way to convert to
> monochrome (with palette) without looping over the pixels. Because our
> requirements allowed it, we ended up saving the 24 bpp TIFF files to disk and
> using a utility to batch convert them once every few minutes.
> HTH,
> Ted
> "Amiram Korach" wrote:
> > My tif image is always 24 bit, no matter what I put in ColorDepth (higher or
> > lower).
> >
> > Do you know how to fix it, or do you know a quick way to change the pixel
> > format of a file?
>|||Amiram,
Here's a snippet that does all the heavy lifting of switching frames,
looping over pixels, and saving the image. Note that, in order to try to
speed this up as much as possile, this uses unsafe code. If you prefer safe
code to performance, you can get rid of the bit twiddling and let .NET set
each bit.
If you have more questions, you can email me. Just take out the "nospam"
parts of my email address.
abyteResult = m_oRS.Render(a_sReportPath, sFormat, sHistoryID, sDevInfo,
a_aoParams, oCredentials, sShowHideToggle,
out sEncoding, out sMimeType, out aoReportHistoryParameters, out
aoWarnings, out sStreamIDs);
// Create a memory stream from our byte array
oStream = new MemoryStream(abyteResult);
// Set the position to the beginning of the stream
oStream.Seek(0, SeekOrigin.Begin);
// Load the stream into an image
Bitmap oImage = new Bitmap(oStream);
// Get number of images (frames)
oFD = new FrameDimension(oImage.FrameDimensionsList[0]);
nFrames = oImage.GetFrameCount(oFD);
/// Write to file using a specific format
// Get an ImageCodecInfo object that represents the TIFF codec.
oImageCodecInfo = oGetCodecInfo("image/tiff");
oEncoderParameters = new EncoderParameters(2);
oEncoder = Encoder.Compression;
oEncoderParameter = new EncoderParameter(oEncoder,
(long)EncoderValue.CompressionNone);
oEncoderParameters.Param[0] = oEncoderParameter;
oEncoder = Encoder.SaveFlag;
oEncoderParameter = new EncoderParameter(oEncoder,
(long)EncoderValue.MultiFrame);
oEncoderParameters.Param[1] = oEncoderParameter;
// COPY IMAGE AND MAKE IT BLACK AND WHITE
Rectangle oRect = new Rectangle(0, 0, oImage.Width, oImage.Height);
PixelFormat oFormat = PixelFormat.Format1bppIndexed;
Bitmap oNew = new Bitmap(oImage.Width, oImage.Height, oFormat);
BitmapData bmd=oNew.LockBits(oRect, ImageLockMode.ReadWrite, oFormat);
for(int y=0;y<oImage.Height;y++) {
for(int x=0;x<oImage.Width;x++) {
if(oImage.GetPixel(x,y).GetBrightness()>0.5f)
this.SetIndexedPixel(x,y,bmd,true);
}
}
oNew.UnlockBits(bmd);
// Save the file using the TIFF codec and the configured parameters
oNew.Save(a_sDestinationPath, oImageCodecInfo, oEncoderParameters);
for (int i=1; i < nFrames; i++) {
Bitmap oCopy;
// Move to the next frame
oImage.SelectActiveFrame(oFD, i);
// oEncoderParameters = new EncoderParameters(3);
oEncoder = Encoder.SaveFlag;
oEncoderParameter = new EncoderParameter(oEncoder,
(long)EncoderValue.FrameDimensionPage);
oEncoderParameters.Param[1] = oEncoderParameter;
oRect = new Rectangle(0, 0, oImage.Width, oImage.Height);
oCopy = new Bitmap(oImage.Width, oImage.Height, oFormat);
bmd=oCopy.LockBits(oRect, ImageLockMode.ReadWrite, oFormat);
for(int y=0;y<oImage.Height;y++) {
for(int x=0;x<oImage.Width;x++) {
if(oImage.GetPixel(x,y).GetBrightness()>0.5f)
this.SetIndexedPixel(x,y,bmd,true);
}
}
oCopy.UnlockBits(bmd);
oNew.SaveAdd(oCopy, oEncoderParameters);
}
oEncoderParameters = new EncoderParameters(1);
oEncoder = Encoder.SaveFlag;
oEncoderParameter = new EncoderParameter(oEncoder, (long)EncoderValue.Flush);
oEncoderParameters.Param[0] = oEncoderParameter;
oNew.SaveAdd(oEncoderParameters);
...
private static ImageCodecInfo oGetCodecInfo(String mimeType) {
int j;
ImageCodecInfo[] encoders;
encoders = ImageCodecInfo.GetImageEncoders();
for(j = 0; j < encoders.Length; ++j) {
if(encoders[j].MimeType == mimeType)
return encoders[j];
}
return null;
}
protected unsafe void SetIndexedPixel(int x,int y,BitmapData bmd, bool
pixel) {
byte* p=(byte*)bmd.Scan0.ToPointer();
int index=y*bmd.Stride+(x>>3);
byte mask=(byte)(0x80>>(x&0x7));
if(pixel)
p[index]|=mask;
else
p[index]&=(byte)(mask^0xff);
}
Regards,
Ted
"Amiram Korach" wrote:
> Thanks a lot.
> I don't care to wait three seconds, because all process is in another
> thread. Batch is too difficult for me, since I need to install it in each
> client machine. Can you show some code for looping over the pixels? My tiff
> file usually contains some frames.
> Thanks
> "Ted K" wrote:
> > Amiram,
> > I don't have a KB article or anything, but MSFT staff have reported that
> > this is a known bug. Unfortunately, it did not get fixed in SP2, and last I
> > heard it did not make the cut for RS 2005 either.
> >
> > I wrote code to loop over the pixels and convert the color depth to
> > monochrome, but it was too slow. It took about 3 seconds for a 600 x 800
> > TIFF, which was too long to do synchronously while the user waited. If you
> > want a color depth that does not require a palette, you can convert it very
> > quickly in code. However, I have failed to find any way to convert to
> > monochrome (with palette) without looping over the pixels. Because our
> > requirements allowed it, we ended up saving the 24 bpp TIFF files to disk and
> > using a utility to batch convert them once every few minutes.
> >
> > HTH,
> > Ted
> >
> > "Amiram Korach" wrote:
> >
> > > My tif image is always 24 bit, no matter what I put in ColorDepth (higher or
> > > lower).
> > >
> > > Do you know how to fix it, or do you know a quick way to change the pixel
> > > format of a file?
> >