Friday, March 30, 2012
Immediate Help Needed Please!
This is a repost from last Friday
Has anyone used the "Jump to Report" to pull up any one report from a
selection of 7 other sub-reports.
I am trying to pull up a specific detail report from 7 sub-reports using an
individual pin # and the "report type" from the main report.
These sub-report types are grouped from type 1 thru 7. I have used the the
"IIF" statement and the "CASE" statement within the (Fx in the Advanced Text
Box Properties) but neither of the statements worked for me. Any help?
Below is my case Statement...
CASE (WHEN ReportType = 1 THEN 'First Report.rdl' WHEN ReportType = 2
THEN 'Second Report.rdl' WHEN ReportType = 3 THEN 'Third Report.rdl' WHEN
ReportType = 4 THEN Fourth Report.rdl' WHEN ReportType = 5 THEN 'Fifth
Report rdl' WHEN ReportType = 6 THEN Sixth Report .rdl' WHEN ReportType = 7 THEN Seventh Report .rdl') ENDWhat is the jump to producing now? Is it jumping to any report? Are you
getting an error message?
"Ben Cole" wrote:
> Hi All,
> This is a repost from last Friday
> Has anyone used the "Jump to Report" to pull up any one report from a
> selection of 7 other sub-reports.
> I am trying to pull up a specific detail report from 7 sub-reports using an
> individual pin # and the "report type" from the main report.
> These sub-report types are grouped from type 1 thru 7. I have used the the
> "IIF" statement and the "CASE" statement within the (Fx in the Advanced Text
> Box Properties) but neither of the statements worked for me. Any help?
> Below is my case Statement...
>
> CASE (WHEN ReportType = 1 THEN 'First Report.rdl' WHEN ReportType = 2
> THEN 'Second Report.rdl' WHEN ReportType = 3 THEN 'Third Report.rdl' WHEN
> ReportType = 4 THEN Fourth Report.rdl' WHEN ReportType = 5 THEN 'Fifth
> Report rdl' WHEN ReportType = 6 THEN Sixth Report .rdl' WHEN ReportType => 7 THEN Seventh Report .rdl') END
>|||Daw,
The error msge I'm getting is: "Report can not be compiled. Verify the
report name and that the report is in the current project."
I made sure the report names are all in the current project and are viewable.
Thx
"daw" wrote:
> What is the jump to producing now? Is it jumping to any report? Are you
> getting an error message?
> "Ben Cole" wrote:
> > Hi All,
> > This is a repost from last Friday
> >
> > Has anyone used the "Jump to Report" to pull up any one report from a
> > selection of 7 other sub-reports.
> > I am trying to pull up a specific detail report from 7 sub-reports using an
> > individual pin # and the "report type" from the main report.
> >
> > These sub-report types are grouped from type 1 thru 7. I have used the the
> > "IIF" statement and the "CASE" statement within the (Fx in the Advanced Text
> > Box Properties) but neither of the statements worked for me. Any help?
> > Below is my case Statement...
> >
> >
> >
> > CASE (WHEN ReportType = 1 THEN 'First Report.rdl' WHEN ReportType = 2
> > THEN 'Second Report.rdl' WHEN ReportType = 3 THEN 'Third Report.rdl' WHEN
> > ReportType = 4 THEN Fourth Report.rdl' WHEN ReportType = 5 THEN 'Fifth
> > Report rdl' WHEN ReportType = 6 THEN Sixth Report .rdl' WHEN ReportType => > 7 THEN Seventh Report .rdl') END
> >|||I tested it with iif and got it to work with the following format:
=iif( Fields!MyField.Value ="MyValue", "Report 1", "Report 2")
I don't think that you can use CASE in the Edit Expression window. This
example assumes that your reports are in the same project. You don't need
.rdl at the end of the names - I grabbed the report names by expanding
Constants in the Edit Expression window.
Hope that helps!
"Ben Cole" wrote:
> Hi All,
> This is a repost from last Friday
> Has anyone used the "Jump to Report" to pull up any one report from a
> selection of 7 other sub-reports.
> I am trying to pull up a specific detail report from 7 sub-reports using an
> individual pin # and the "report type" from the main report.
> These sub-report types are grouped from type 1 thru 7. I have used the the
> "IIF" statement and the "CASE" statement within the (Fx in the Advanced Text
> Box Properties) but neither of the statements worked for me. Any help?
> Below is my case Statement...
>
> CASE (WHEN ReportType = 1 THEN 'First Report.rdl' WHEN ReportType = 2
> THEN 'Second Report.rdl' WHEN ReportType = 3 THEN 'Third Report.rdl' WHEN
> ReportType = 4 THEN Fourth Report.rdl' WHEN ReportType = 5 THEN 'Fifth
> Report rdl' WHEN ReportType = 6 THEN Sixth Report .rdl' WHEN ReportType => 7 THEN Seventh Report .rdl') END
>|||Thx daw for your help... I did try your example and still got the same error
msge.
I hope I'm not asking for too much here?
I was wondering if you can convert my CASE statement below with IIF
statement so I see what it actually looks like
thx for all your help!!
"daw" wrote:
> I tested it with iif and got it to work with the following format:
> =iif( Fields!MyField.Value ="MyValue", "Report 1", "Report 2")
> I don't think that you can use CASE in the Edit Expression window. This
> example assumes that your reports are in the same project. You don't need
> .rdl at the end of the names - I grabbed the report names by expanding
> Constants in the Edit Expression window.
> Hope that helps!
> "Ben Cole" wrote:
> > Hi All,
> > This is a repost from last Friday
> >
> > Has anyone used the "Jump to Report" to pull up any one report from a
> > selection of 7 other sub-reports.
> > I am trying to pull up a specific detail report from 7 sub-reports using an
> > individual pin # and the "report type" from the main report.
> >
> > These sub-report types are grouped from type 1 thru 7. I have used the the
> > "IIF" statement and the "CASE" statement within the (Fx in the Advanced Text
> > Box Properties) but neither of the statements worked for me. Any help?
> > Below is my case Statement...
> >
> >
> >
> > CASE (WHEN ReportType = 1 THEN 'First Report.rdl' WHEN ReportType = 2
> > THEN 'Second Report.rdl' WHEN ReportType = 3 THEN 'Third Report.rdl' WHEN
> > ReportType = 4 THEN Fourth Report.rdl' WHEN ReportType = 5 THEN 'Fifth
> > Report rdl' WHEN ReportType = 6 THEN Sixth Report .rdl' WHEN ReportType => > 7 THEN Seventh Report .rdl') END
> >|||Try this:
=iif(Fields!ReportType.Value =1, "First Report",iif(Fields!ReportType.Value
=2, "Second Report",iif(Fields!ReportType.Value =3, "Third Report",
iif(Fields!ReportType.Value =4,"Fourth Report" ,iif(Fields!ReportType.Value
=5, "Fifth Report", iif(Fields!ReportType.Value =6,"Sixth Report","Seventh
Report"))))))
This statement assumes that if the ReportType value is not 1 through 6, that
it is 7 and will jump to the seventh report. Good luck!
"Ben Cole" wrote:
> Thx daw for your help... I did try your example and still got the same error
> msge.
> I hope I'm not asking for too much here?
> I was wondering if you can convert my CASE statement below with IIF
> statement so I see what it actually looks like
> thx for all your help!!
> "daw" wrote:
> > I tested it with iif and got it to work with the following format:
> >
> > =iif( Fields!MyField.Value ="MyValue", "Report 1", "Report 2")
> >
> > I don't think that you can use CASE in the Edit Expression window. This
> > example assumes that your reports are in the same project. You don't need
> > .rdl at the end of the names - I grabbed the report names by expanding
> > Constants in the Edit Expression window.
> >
> > Hope that helps!
> >
> > "Ben Cole" wrote:
> >
> > > Hi All,
> > > This is a repost from last Friday
> > >
> > > Has anyone used the "Jump to Report" to pull up any one report from a
> > > selection of 7 other sub-reports.
> > > I am trying to pull up a specific detail report from 7 sub-reports using an
> > > individual pin # and the "report type" from the main report.
> > >
> > > These sub-report types are grouped from type 1 thru 7. I have used the the
> > > "IIF" statement and the "CASE" statement within the (Fx in the Advanced Text
> > > Box Properties) but neither of the statements worked for me. Any help?
> > > Below is my case Statement...
> > >
> > >
> > >
> > > CASE (WHEN ReportType = 1 THEN 'First Report.rdl' WHEN ReportType = 2
> > > THEN 'Second Report.rdl' WHEN ReportType = 3 THEN 'Third Report.rdl' WHEN
> > > ReportType = 4 THEN Fourth Report.rdl' WHEN ReportType = 5 THEN 'Fifth
> > > Report rdl' WHEN ReportType = 6 THEN Sixth Report .rdl' WHEN ReportType => > > 7 THEN Seventh Report .rdl') END
> > >|||A BIG Thx to you, daw!!! I finally got it to work!!
Thx again!
"daw" wrote:
> Try this:
> =iif(Fields!ReportType.Value =1, "First Report",iif(Fields!ReportType.Value
> =2, "Second Report",iif(Fields!ReportType.Value =3, "Third Report",
> iif(Fields!ReportType.Value =4,"Fourth Report" ,iif(Fields!ReportType.Value
> =5, "Fifth Report", iif(Fields!ReportType.Value =6,"Sixth Report","Seventh
> Report"))))))
> This statement assumes that if the ReportType value is not 1 through 6, that
> it is 7 and will jump to the seventh report. Good luck!
> "Ben Cole" wrote:
> > Thx daw for your help... I did try your example and still got the same error
> > msge.
> >
> > I hope I'm not asking for too much here?
> > I was wondering if you can convert my CASE statement below with IIF
> > statement so I see what it actually looks like
> > thx for all your help!!
> >
> > "daw" wrote:
> >
> > > I tested it with iif and got it to work with the following format:
> > >
> > > =iif( Fields!MyField.Value ="MyValue", "Report 1", "Report 2")
> > >
> > > I don't think that you can use CASE in the Edit Expression window. This
> > > example assumes that your reports are in the same project. You don't need
> > > .rdl at the end of the names - I grabbed the report names by expanding
> > > Constants in the Edit Expression window.
> > >
> > > Hope that helps!
> > >
> > > "Ben Cole" wrote:
> > >
> > > > Hi All,
> > > > This is a repost from last Friday
> > > >
> > > > Has anyone used the "Jump to Report" to pull up any one report from a
> > > > selection of 7 other sub-reports.
> > > > I am trying to pull up a specific detail report from 7 sub-reports using an
> > > > individual pin # and the "report type" from the main report.
> > > >
> > > > These sub-report types are grouped from type 1 thru 7. I have used the the
> > > > "IIF" statement and the "CASE" statement within the (Fx in the Advanced Text
> > > > Box Properties) but neither of the statements worked for me. Any help?
> > > > Below is my case Statement...
> > > >
> > > >
> > > >
> > > > CASE (WHEN ReportType = 1 THEN 'First Report.rdl' WHEN ReportType = 2
> > > > THEN 'Second Report.rdl' WHEN ReportType = 3 THEN 'Third Report.rdl' WHEN
> > > > ReportType = 4 THEN Fourth Report.rdl' WHEN ReportType = 5 THEN 'Fifth
> > > > Report rdl' WHEN ReportType = 6 THEN Sixth Report .rdl' WHEN ReportType => > > > 7 THEN Seventh Report .rdl') END
> > > >
Wednesday, March 28, 2012
Images will not show in report
I have tried to add it all three ways, but still no luck. Is there something
that I am missing?
I can see the image when I preview the report locally, but when I deploy the
report to the sever, I cannot view the image either from the Report Server or
through my .NET application that is utilizing the report.
Any help would be greatly appreciated.You can try making it an embedded image.
Add the image as a new embedded image to the report. (Reports\Images)
Then, design your report by adding an image to it from the toolbox.
Set the properties for that image to point to the embedded image you added.
You can make it an linked image by setting the properties to point to a
path. http://myserver/myimageshare/myimage.jpg
--
| Thread-Topic: Images will not show in report
| thread-index: AcWC+zNf2GzxbBXnQVO+cfwpRtcPTg==| X-WBNR-Posting-Host: 69.213.32.34
| From: "=?Utf-8?B?RXJpYyBHbmFnZXk=?=" <Eric
Gnagey@.discussions.microsoft.com>
| Subject: Images will not show in report
| Date: Thu, 7 Jul 2005 06:53:06 -0700
| Lines: 9
| Message-ID: <3EBB5FE6-34BE-4211-BA22-5003727008B2@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.reportingsvcs
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.reportingsvcs:47590
| X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
|
| I am trying to add a Company Logo image to my report and it will not
render.
| I have tried to add it all three ways, but still no luck. Is there
something
| that I am missing?
|
| I can see the image when I preview the report locally, but when I deploy
the
| report to the sever, I cannot view the image either from the Report
Server or
| through my .NET application that is utilizing the report.
|
| Any help would be greatly appreciated.
|sql
Images rendering poorly?
in the reports? When I add our company logo (a gif) to a report, it looks
fine in the development environment. Also, when I export the reports (say,
to a pdf) the images are fine, but when I view the report in a browser
(through the reporting services) the image is slightly skewed. Has anyone
else run across this, and if so, any idea on how to fix this?
Thanks for any help offered.Yes Hammer I have also had this problem for some time now. I have tried all
forms of image input into the report (embedded, project, database, and web)
and all have the same results; a lower quality image.
Anyone else?
"The Hammer" <david.hamilton@.datashapers.com> wrote in message
news:OCHYNpw1EHA.1296@.TK2MSFTNGP10.phx.gbl...
> Has anyone else out there had any problems with images rendering
> improperly
> in the reports? When I add our company logo (a gif) to a report, it looks
> fine in the development environment. Also, when I export the reports (say,
> to a pdf) the images are fine, but when I view the report in a browser
> (through the reporting services) the image is slightly skewed. Has anyone
> else run across this, and if so, any idea on how to fix this?
> Thanks for any help offered.
>
Images on a report
What am I doing wrong?
Thanks
dear,
What is the source of the image.
I mean from database,or web or Disk.
HTH
from
sufian
|||The image is embedded into the report - it resides on the disk of the server.I've got round the problem to an extent by making a textbox, typing the text and then setting a background image that is exactly the same size as the textbox, but if you get the textbox slightly too big or small, it either cuts a bit off or repeats (I could switch off the repeat I s'pose).|||
Dear,
Set the backgroundrepeat option to norepeat.
HTH
from
sufian
Images on a report
Hi being new to reporting services this is probably simple, so here goes.
Using Visual Studio 2005 to create the report. I have a SQLExpress db.
In the Product table that I want to run the report on there is a field called ImageName it contains the image filename e.g CanonIXUS.jpg
and I have a directory with all the images in it.
So how do I get the report writer to show the Image for the product in the row?
Thanks
Please check the documentation:
http://msdn2.microsoft.com/en-us/library/ms156482(SQL.90).aspx
In your case, it sounds like you want to add an "external" image where you will need to dynamically construct the path with an expression.
-- Robert
|||Hi,
Thanks for that.
However all the documentation talks of an image wizard and various properties when you drag an image control onto a report.
Unfortunatly after adding a report (test.rdlc) to my VS2005 project none of these options seem to be available to me. I can easily display data but I don't have a place to select the various properties for an image eg. "external" .
Any Ideas ?
|||You can use the VS property browser to set the image properties. To set the source of an image to "external", select the image, go to the Properties window and locate the Source property.
-Albert
Images on a report
Hi being new to reporting services this is probably simple, so here goes.
Using Visual Studio 2005 to create the report. I have a SQLExpress db.
In the Product table that I want to run the report on there is a field called ImageName it contains the image filename e.g CanonIXUS.jpg
and I have a directory with all the images in it.
So how do I get the report writer to show the Image for the product in the row?
Thanks
Please check the documentation:
http://msdn2.microsoft.com/en-us/library/ms156482(SQL.90).aspx
In your case, it sounds like you want to add an "external" image where you will need to dynamically construct the path with an expression.
-- Robert
|||Hi,
Thanks for that.
However all the documentation talks of an image wizard and various properties when you drag an image control onto a report.
Unfortunatly after adding a report (test.rdlc) to my VS2005 project none of these options seem to be available to me. I can easily display data but I don't have a place to select the various properties for an image eg. "external" .
Any Ideas ?
|||You can use the VS property browser to set the image properties. To set the source of an image to "external", select the image, go to the Properties window and locate the Source property.
-Albert
sqlImages not lining up with text box
This is a poorly done illustration of how my header is laid out, as my description may be a bit confusing.
__
|TEXTBOX (Report title) |
|TEXTBOX (Widget caption) | Image|
Thanks
|||
Hey Dude,
Dunno if you have found a fix for this but i found using rectangles a huge help in aligning multi text boxes... maybe the same can help here
Stephen
Images not lining up with text box
This is a poorly done illustration of how my header is laid out, as my description may be a bit confusing.
__
|TEXTBOX (Report title) |
|TEXTBOX (Widget caption) | Image|
Thanks
|||
Hey Dude,
Dunno if you have found a fix for this but i found using rectangles a huge help in aligning multi text boxes... maybe the same can help here
Stephen
images not lined up
i have a large image in the header of the report but when
i deploy a report to the report server the images and
words in the header of the report are not lined up with
the rest of the report i have smaller images in the
footer of the report that line up fine any ideas on this?
thanks in advance
jeremyYou may have overlapping report items. This is only supported in image
oriented output formats (e.g. Preview, TIFF, PDF), but not in HTML.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"jeremy" <anonymous@.discussions.microsoft.com> wrote in message
news:0a1e01c499a6$cafd3830$3501280a@.phx.gbl...
> hi all
> i have a large image in the header of the report but when
> i deploy a report to the report server the images and
> words in the header of the report are not lined up with
> the rest of the report i have smaller images in the
> footer of the report that line up fine any ideas on this?
> thanks in advance
> jeremy|||If you use a drillthrough action, then just specifying the report name and
parameters is sufficient.
See also:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSUIREF/htm/f1_rsc_designer_v1_34fi.asp
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"jeremy" <jeremy@.discussions.microsoft.com> wrote in message
news:48FE0851-F250-46A3-B54D-DC2471B47167@.microsoft.com...
> thanks for your help
> the images were overlapping and once i changed that the reports look fine
> now im having a problem where im navigating from one report to another
> the second report does not load on the report server do i have to set
the
> link to the url or am i missing something with the link to the other
report
> "Robert Bruckner [MSFT]" wrote:
> > You may have overlapping report items. This is only supported in image
> > oriented output formats (e.g. Preview, TIFF, PDF), but not in HTML.
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no
rights.
> >
> >
> > "jeremy" <anonymous@.discussions.microsoft.com> wrote in message
> > news:0a1e01c499a6$cafd3830$3501280a@.phx.gbl...
> > > hi all
> > > i have a large image in the header of the report but when
> > > i deploy a report to the report server the images and
> > > words in the header of the report are not lined up with
> > > the rest of the report i have smaller images in the
> > > footer of the report that line up fine any ideas on this?
> > > thanks in advance
> > > jeremy
> >
> >
> >
Images not displaying on reports!
These images are being copied and pasted into an ACCESS application (w/, as said above, a SQL Server back-end)....
All I get on the report is a box with a red 'X'.
(Now, I have tried the routine to remove the OLE header as suggested on other places on the Internet. While this works for the Northwind images, this is not working on our images. Which leads me to guess that the OLE Header on our images may be different than 78. But how do we know or calculate that?)..
My guess would be that some other people have encountered similar problems.
Any help will be highly appreciated.
Thanks..
Were you able to find the solution for this?
I'm encountering the same problem.
Thanks!
sqlImages not displaying
I have images that reside in a database table on SQL server. When previewing
a report in Report Designer, the images display just fine. After uploading
the report to Report Manager, the images don't display and a red x displays.
Another issue is that the graph on the report is not displaying as well. A
red x displays instead. Again, the report previews perfectly in Report
Designer. Any suggestions?
Thanks!One more thing I forgot to mention. All drilldowns are not working either.
When you click on a drilldown, it makes the "click" sound and moves a bit to
the left. It doesn't drilldown. Again, it works just fine in Report Designer.
"clutch" wrote:
> Hi,
> I have images that reside in a database table on SQL server. When previewing
> a report in Report Designer, the images display just fine. After uploading
> the report to Report Manager, the images don't display and a red x displays.
> Another issue is that the graph on the report is not displaying as well. A
> red x displays instead. Again, the report previews perfectly in Report
> Designer. Any suggestions?
> Thanks!
Images Not Displayed On Server
The reports are displayed fine on my machine and on the test server we use for demo builds.
When I place a build on our remote webserver the images don't display correctly. They don't show up as red x's, but only the outline of the image and the icon specifying that the object is an image is visible. Another developer is working with the project on his machine and is experiencing the same problem.
What could be causing this? I don't think this is a permissions issue, as I have given both Everyone and IUSER full read privileges on the image directories of both problem machines.
I am running Windows XP Pro and we are using Framework V1.1. The problem machines are running windows server 2003 and windows server 2000 respectively.
Does anyone have any clue as to what the problem could be?
Thanks,
RonWhere the image files are stored? Have u tested the path is taken in a right way by ur server. (i.e, it may points to local path)|||Hmm, well the path shown when I right click and view properties of the image isn't anything that I can go check... it is an image that is dynamically generated by the report engine.
Do you know of anyway I can specify the image locations as relative, as opposed to absolute? The test server that works fine is using a directory structure identical to the one I am using, however the other two machines are slightly different.
If you know how to specify a path as relative please let me know, I really appreciate it.
Ron|||I'm not sure is this the right way?
For static images, store the image files in the folder where rpt files are located.
Goto your report, select the image from that path. It'll work will accessing from the server.
But for dynamic images? If it is dynamic, u must have specified the path somewhere in your code. right?|||No, the images are all being specified correctly... in fact, when I generate a PDF or Word document from the report the images display just fine.
I am really curious as to what could be causing this?|||Sorry, no idea
Try to search businessobjects web site. U may have some info.
Images not being displayed.
1. I am using the webservice to render the images from a report, and they dont render.
I paste this URL to the browser
http://agamenon:90/ReportServer?%2fGescomRpts%2fRPT_MediosDesarrollo&rs%3aFormat=HTML4.0&rs:ImageID=6c809239-753f-4988-abcf-231416dff0d6
and I get this
No se encuentra la secuencia. No se encuentra el identificador de secuencia proporcionado a una operación en la base de datos del servidor de informes. (rsStreamNotFound) Obtener ayuda en pantalla
This is the code
the problem is that I need to know the streamid, and to know the streamid I first have to render the report where the image is to be placed.
This is the page getimage.aspx
protected void Page_Load(object sender, EventArgs e)
{
string reportPath = Server.UrlDecode(Request["report"]);
//string streamID = Request["streamid"];
ReportExecutionService rs = (ReportExecutionService)Session["rs"];
DataSourceCredentials[] credentials = null;
string showHideToggle = null;
string encoding;
string mimeType;
string extension;
Warning[] warnings = null;
ParameterValue[] reportHistoryParameters = null;
string historyID = null;
string[] streamIDs = null;
ServerInfoHeader sh = new ServerInfoHeader();
rs.ServerInfoHeaderValue = sh;
byte[] result = null;
ParameterValue[] reportParameterValues2 = null;
string deviceInfo = "<DeviceInfo>" +
//"<StreamRoot>" + streamRoot + "</StreamRoot>" +
"<Toolbar>False</Toolbar>" +
"<Parameters>False</Parameters>" +
"<HTMLFragment>True</HTMLFragment>" +
"<StyleStream>False</StyleStream>" +
"<Section>0</Section>" +
"<Zoom>" +
"</Zoom>" +
"</DeviceInfo>";
result = rs.Render("HTML4.0", deviceInfo, out extension, out mimeType, out encoding, out warnings, out streamIDs);
string streamID = streamIDs[0];
string encodingImage;
string mimeTypeImage;
byte[] image;
ParameterValue[] pv = (ParameterValue[])Session["reportParameterValues"];
//image = rs.RenderStream(reportPath, "HTML4.0", streamID, null, null, pv, out encodingImage, out mimeTypeImage);
image=rs.RenderStream("HTML4.0", streamID, null, out encodingImage, out mimeTypeImage);
Response.Clear();
Response.ContentType = mimeTypeImage;
Response.AppendHeader("content-length", image.Length.ToString());
Response.BinaryWrite(image);
Response.Flush();
Response.Close();
}
and this is the page of the report. Sorry for the long code.
if (reportCanBeRendered)
{
string deviceInfo;
string streamRoot;
Session["rs"] = rs;
streamRoot = ("getimage.aspx?report="+ (path + "&streamid="));
switch (format)
{
case "HTML4.0":
case "HTML3.2":
deviceInfo = "<DeviceInfo>" +
"<StreamRoot></StreamRoot>" +
"<Toolbar>False</Toolbar>" +
"<Parameters>False</Parameters>" +
"<HTMLFragment>True</HTMLFragment>" +
"<StyleStream>False</StyleStream>" +
"<Section>0</Section>" +
"<Zoom>" +
"</Zoom>" +
"</DeviceInfo>";
break;
default:
deviceInfo = "<DeviceInfo></DeviceInfo>";
break;
}
// SQLRS-ReportViewer
if (!(reportParameterValues == null))
{
//reportParameterValues2 = reportParameterValues.ToArray(typeof(ParameterValue));
//reportParameterValues2 = (ParameterValue[])reportParameterValues.ToArray(typeof(ParameterValue));
}
DataSourceCredentials[] credentials = null;
string showHideToggle = null;
string encoding;
string mimeType;
string extension;
Warning[] warnings = null;
ParameterValue[] reportHistoryParameters = null;
string historyID = null;
string[] streamIDs = null;
ServerInfoHeader sh = new ServerInfoHeader();
rs.ServerInfoHeaderValue = sh;
byte[] result = null;
ParameterValue[] reportParameterValues2 = null;
result = rs.Render(format, deviceInfo, out extension, out mimeType, out encoding, out warnings, out streamIDs);
streamRoot = "getimage.aspx?report=" + path + "&streamid=" + streamIDs[0];
//string reportPath2 = Server.UrlDecode(Request["report"]);
//string streamID = streamIDs[0];
////string streamID = "";
//ReportExecutionService rs2 = new ReportExecutionService();
//Session["rs"] = rs;
//rs2=(ReportExecutionService)Session["rs"];
//////ReportingService rs = (ReportingService)Session["rs"];
//string encodingImage;
//string mimeTypeImage;
//byte[] image;
//ParameterValue[] pv = (ParameterValue[])Session["reportParameterValues"];
//////image = rs.RenderStream(reportPath, "HTML4.0", streamID, null, null, pv, out encodingImage, out mimeTypeImage);
//image = rs2.RenderStream("HTML4.0", streamID, null, out encodingImage, out mimeTypeImage);
//Response.Clear();
//Response.ContentType = mimeTypeImage;
//Response.AppendHeader("content-length", image.Length.ToString());
//Response.BinaryWrite(image);
//Response.Flush();
//Response.Close();
// store ReportingServices and parameters object is session layer in case we need it for image streams
Session["rs"] = rs;
Session["reportParameterValues"] = reportParameterValues2;
switch (format)
{
case "HTML4.0":
case "HTML3.2":
System.Text.Encoding enc = System.Text.Encoding.UTF8;
// get the report as a string
string tmpReport = enc.GetString(result);
// replace all occurrences of report server link with current page link
tmpReport = tmpReport.Replace(reportServerURL.Replace("/ReportService.asmx", "?"), ("http://"
+ (Request["SERVER_NAME"]
+ (Request["SCRIPT_NAME"] + "?Report="))));
ReportPlaceholder.InnerHtml = tmpReport;
break;
default:
Response.ClearContent();
Response.AppendHeader("content-length", result.Length.ToString());
Response.ContentType = mimeType;
Response.BinaryWrite(result);
Response.Flush();
Response.Close();
break;
}
}
I actually solved the proble, this code has a little of garbage, but it began working.
private void GenerarInPlaceHTML()
{
string path = reportPath+ "RPT_MediosDesarrollo";
ReportExecutionService rs = new ReportExecutionService();
rs.Url = reportServerURL;
System.Net.NetworkCredential reportCredentials = new System.Net.NetworkCredential(reportUser, userPassword, domain);
rs.Credentials = reportCredentials;
// see if Report URL parameter is defined and if it is then consider that report
if (!(Request["Report"] == null))
{
reportPath = Request["Report"];
}
// set the Report hidden parameter
Report.Value = reportPath;
// Get the list of parameters. without specifing to render the report (ForRendering set to false)
// valid values for these parameters will not be populated
ExecutionInfo execInfo;
execInfo = rs.LoadReport(path, null);
ReportParameter[] reportParametersArray = execInfo.Parameters;
//reportParametersArray = rs.GetReportParameters(path, null, false, null, null);
//// If there are parametrs then we generate an array with values that should be populated from either
//// - previous submission ,
//// - URL parameters,
//// - default value defined inside the report
//// some usefull declarations
System.Web.UI.HtmlControls.HtmlTableRow TR = new HtmlTableRow();
System.Web.UI.HtmlControls.HtmlTableCell TD;
System.Web.UI.HtmlControls.HtmlSelect S;
System.Web.UI.WebControls.ListItem LI;
System.Web.UI.HtmlControls.HtmlInputText T;
//// hash table with dependecies
System.Collections.Hashtable Dependencies = new System.Collections.Hashtable();
//// we need a dynamic array for storing parameter values
ArrayList reportParameterValues= new ArrayList();
if (reportCanBeRendered)
{
string deviceInfo;
string streamRoot;
Session["rs"] = rs;
streamRoot = ("getimage.aspx?report="+ (path + "&streamid="));
switch (format)
{
case "HTML4.0":
case "HTML3.2":
deviceInfo = "<DeviceInfo>" +
"<StreamRoot>http://ImagenesTemporales/</StreamRoot>" +
"<Toolbar>False</Toolbar>" +
"<Parameters>False</Parameters>" +
"<HTMLFragment>True</HTMLFragment>" +
"<StyleStream>False</StyleStream>" +
"<Section>0</Section>" +
"<Zoom>" +
"</Zoom>" +
"</DeviceInfo>";
break;
default:
deviceInfo = "<DeviceInfo></DeviceInfo>";
break;
}
// SQLRS-ReportViewer
if (!(reportParameterValues == null))
{
//reportParameterValues2 = reportParameterValues.ToArray(typeof(ParameterValue));
//reportParameterValues2 = (ParameterValue[])reportParameterValues.ToArray(typeof(ParameterValue));
}
DataSourceCredentials[] credentials = null;
string showHideToggle = null;
string encoding;
string mimeType;
string extension;
Warning[] warnings = null;
ParameterValue[] reportHistoryParameters = null;
string historyID = null;
string[] streamIDs = null;
ServerInfoHeader sh = new ServerInfoHeader();
rs.ServerInfoHeaderValue = sh;
byte[] result = null;
ParameterValue[] reportParameterValues2 = null;
result = rs.Render(format, deviceInfo, out extension, out mimeType, out encoding, out warnings, out streamIDs);
string encodingImage;
string mimeTypeImage;
byte[] image = rs.RenderStream("HTML4.0", streamIDs[0], null, out encodingImage,out mimeTypeImage);
System.IO.FileStream fs = System.IO.File.OpenWrite(@."C:\Inetpub\wwwroot\GescomDllo\ImagenesTemporales\" + streamIDs[0]);
fs.Write(image, 0, Convert.ToInt32(image.Length));
fs.Close();
// store ReportingServices and parameters object is session layer in case we need it for image streams
Session["rs"] = rs;
Session["reportParameterValues"] = reportParameterValues2;
switch (format)
{
case "HTML4.0":
case "HTML3.2":
System.Text.Encoding enc = System.Text.Encoding.UTF8;
// get the report as a string
string tmpReport = enc.GetString(result);
// replace all occurrences of report server link with current page link
tmpReport = tmpReport.Replace(reportServerURL.Replace("/ReportService.asmx", "?"), ("http://"
+ (Request["SERVER_NAME"]
+ (Request["SCRIPT_NAME"] + "?Report="))));
ReportPlaceholder.InnerHtml = tmpReport;
break;
default:
Response.ClearContent();
Response.AppendHeader("content-length", result.Length.ToString());
Response.ContentType = mimeType;
Response.BinaryWrite(result);
Response.Flush();
Response.Close();
break;
}
}
}
|||Thanks buddy!!!
you answer helped me, though it was tough to figure out what i was doing wrong previosly. the only mistake i was doing is here .
it should be this.
image=rs.RenderStream("HTML4.0", streamID, null, out encodingImage, out mimeTypeImage);
i was doing this.
image=rs.RenderStream("IMAGE", streamID, null, out encodingImage, out mimeTypeImage);
Thanks again
|||
Luis Esteban, tendras ese mismo codigo pero para reporting services 2000?
Saludos
Images not being displayed.
1. I am using the webservice to render the images from a report, and they dont render.
I paste this URL to the browser
http://agamenon:90/ReportServer?%2fGescomRpts%2fRPT_MediosDesarrollo&rs%3aFormat=HTML4.0&rs:ImageID=6c809239-753f-4988-abcf-231416dff0d6
and I get this
No se encuentra la secuencia. No se encuentra el identificador de secuencia proporcionado a una operación en la base de datos del servidor de informes. (rsStreamNotFound) Obtener ayuda en pantalla
This is the code
the problem is that I need to know the streamid, and to know the streamid I first have to render the report where the image is to be placed.
This is the page getimage.aspx
protectedvoid Page_Load(object sender, EventArgs e)
{
string reportPath = Server.UrlDecode(Request["report"]);
//string streamID = Request["streamid"];
ReportExecutionService rs = (ReportExecutionService)Session["rs"];
DataSourceCredentials[] credentials = null;
string showHideToggle = null;
string encoding;
string mimeType;
string extension;
Warning[] warnings = null;
ParameterValue[] reportHistoryParameters = null;
string historyID = null;
string[] streamIDs = null;
ServerInfoHeader sh = newServerInfoHeader();
rs.ServerInfoHeaderValue = sh;
byte[] result = null;
ParameterValue[] reportParameterValues2 = null;
string deviceInfo = "<DeviceInfo>" +
//"<StreamRoot>" + streamRoot + "</StreamRoot>" +
"<Toolbar>False</Toolbar>" +
"<Parameters>False</Parameters>" +
"<HTMLFragment>True</HTMLFragment>" +
"<StyleStream>False</StyleStream>" +
"<Section>0</Section>" +
"<Zoom>" +
"</Zoom>" +
"</DeviceInfo>";
result = rs.Render("HTML4.0", deviceInfo, out extension, out mimeType, out encoding, out warnings, out streamIDs);
string streamID = streamIDs[0];
string encodingImage;
string mimeTypeImage;
byte[] image;
ParameterValue[] pv = (ParameterValue[])Session["reportParameterValues"];
//image = rs.RenderStream(reportPath, "HTML4.0", streamID, null, null, pv, out encodingImage, out mimeTypeImage);
image=rs.RenderStream("HTML4.0", streamID, null, out encodingImage, out mimeTypeImage);
Response.Clear();
Response.ContentType = mimeTypeImage;
Response.AppendHeader("content-length", image.Length.ToString());
Response.BinaryWrite(image);
Response.Flush();
Response.Close();
}
and this is the page of the report. Sorry for the long code.
if (reportCanBeRendered)
{
string deviceInfo;
string streamRoot;
Session["rs"] = rs;
streamRoot = ("getimage.aspx?report="+ (path + "&streamid="));
switch (format)
{
case"HTML4.0":
case"HTML3.2":
deviceInfo = "<DeviceInfo>" +
"<StreamRoot></StreamRoot>" +
"<Toolbar>False</Toolbar>" +
"<Parameters>False</Parameters>" +
"<HTMLFragment>True</HTMLFragment>" +
"<StyleStream>False</StyleStream>" +
"<Section>0</Section>" +
"<Zoom>" +
"</Zoom>" +
"</DeviceInfo>";
break;
default:
deviceInfo = "<DeviceInfo></DeviceInfo>";
break;
}
// SQLRS-ReportViewer
if (!(reportParameterValues == null))
{
//reportParameterValues2 = reportParameterValues.ToArray(typeof(ParameterValue));
//reportParameterValues2 = (ParameterValue[])reportParameterValues.ToArray(typeof(ParameterValue));
}
DataSourceCredentials[] credentials = null;
string showHideToggle = null;
string encoding;
string mimeType;
string extension;
Warning[] warnings = null;
ParameterValue[] reportHistoryParameters = null;
string historyID = null;
string[] streamIDs = null;
ServerInfoHeader sh = newServerInfoHeader();
rs.ServerInfoHeaderValue = sh;
byte[] result = null;
ParameterValue[] reportParameterValues2 = null;
result = rs.Render(format, deviceInfo, out extension, out mimeType, out encoding, out warnings, out streamIDs);
streamRoot = "getimage.aspx?report=" + path + "&streamid=" + streamIDs[0];
//string reportPath2 = Server.UrlDecode(Request["report"]);
//string streamID = streamIDs[0];
////string streamID = "";
//ReportExecutionService rs2 = new ReportExecutionService();
//Session["rs"] = rs;
//rs2=(ReportExecutionService)Session["rs"];
//////ReportingService rs = (ReportingService)Session["rs"];
//string encodingImage;
//string mimeTypeImage;
//byte[] image;
//ParameterValue[] pv = (ParameterValue[])Session["reportParameterValues"];
//////image = rs.RenderStream(reportPath, "HTML4.0", streamID, null, null, pv, out encodingImage, out mimeTypeImage);
//image = rs2.RenderStream("HTML4.0", streamID, null, out encodingImage, out mimeTypeImage);
//Response.Clear();
//Response.ContentType = mimeTypeImage;
//Response.AppendHeader("content-length", image.Length.ToString());
//Response.BinaryWrite(image);
//Response.Flush();
//Response.Close();
// store ReportingServices and parameters object is session layer in case we need it for image streams
Session["rs"] = rs;
Session["reportParameterValues"] = reportParameterValues2;
switch (format)
{
case"HTML4.0":
case"HTML3.2":
System.Text.Encoding enc = System.Text.Encoding.UTF8;
// get the report as a string
string tmpReport = enc.GetString(result);
// replace all occurrences of report server link with current page link
tmpReport = tmpReport.Replace(reportServerURL.Replace("/ReportService.asmx", "?"), ("http://"
+ (Request["SERVER_NAME"]
+ (Request["SCRIPT_NAME"] + "?Report="))));
ReportPlaceholder.InnerHtml = tmpReport;
break;
default:
Response.ClearContent();
Response.AppendHeader("content-length", result.Length.ToString());
Response.ContentType = mimeType;
Response.BinaryWrite(result);
Response.Flush();
Response.Close();
break;
}
}
I actually solved the proble, this code has a little of garbage, but it began working.
privatevoid GenerarInPlaceHTML()
{
string path = reportPath+ "RPT_MediosDesarrollo";
ReportExecutionService rs = newReportExecutionService();
rs.Url = reportServerURL;
System.Net.NetworkCredential reportCredentials = new System.Net.NetworkCredential(reportUser, userPassword, domain);
rs.Credentials = reportCredentials;
// see if Report URL parameter is defined and if it is then consider that report
if (!(Request["Report"] == null))
{
reportPath = Request["Report"];
}
// set the Report hidden parameter
Report.Value = reportPath;
// Get the list of parameters. without specifing to render the report (ForRendering set to false)
// valid values for these parameters will not be populated
ExecutionInfo execInfo;
execInfo = rs.LoadReport(path, null);
ReportParameter[] reportParametersArray = execInfo.Parameters;
//reportParametersArray = rs.GetReportParameters(path, null, false, null, null);
//// If there are parametrs then we generate an array with values that should be populated from either
//// - previous submission ,
//// - URL parameters,
//// - default value defined inside the report
//// some usefull declarations
System.Web.UI.HtmlControls.HtmlTableRow TR = newHtmlTableRow();
System.Web.UI.HtmlControls.HtmlTableCell TD;
System.Web.UI.HtmlControls.HtmlSelect S;
System.Web.UI.WebControls.ListItem LI;
System.Web.UI.HtmlControls.HtmlInputText T;
//// hash table with dependecies
System.Collections.Hashtable Dependencies = new System.Collections.Hashtable();
//// we need a dynamic array for storing parameter values
ArrayList reportParameterValues= newArrayList();
if (reportCanBeRendered)
{
string deviceInfo;
string streamRoot;
Session["rs"] = rs;
streamRoot = ("getimage.aspx?report="+ (path + "&streamid="));
switch (format)
{
case"HTML4.0":
case"HTML3.2":
deviceInfo = "<DeviceInfo>" +
"<StreamRoot>http://ImagenesTemporales/</StreamRoot>" +
"<Toolbar>False</Toolbar>" +
"<Parameters>False</Parameters>" +
"<HTMLFragment>True</HTMLFragment>" +
"<StyleStream>False</StyleStream>" +
"<Section>0</Section>" +
"<Zoom>" +
"</Zoom>" +
"</DeviceInfo>";
break;
default:
deviceInfo = "<DeviceInfo></DeviceInfo>";
break;
}
// SQLRS-ReportViewer
if (!(reportParameterValues == null))
{
//reportParameterValues2 = reportParameterValues.ToArray(typeof(ParameterValue));
//reportParameterValues2 = (ParameterValue[])reportParameterValues.ToArray(typeof(ParameterValue));
}
DataSourceCredentials[] credentials = null;
string showHideToggle = null;
string encoding;
string mimeType;
string extension;
Warning[] warnings = null;
ParameterValue[] reportHistoryParameters = null;
string historyID = null;
string[] streamIDs = null;
ServerInfoHeader sh = newServerInfoHeader();
rs.ServerInfoHeaderValue = sh;
byte[] result = null;
ParameterValue[] reportParameterValues2 = null;
result = rs.Render(format, deviceInfo, out extension, out mimeType, out encoding, out warnings, out streamIDs);
string encodingImage;
string mimeTypeImage;
byte[] image = rs.RenderStream("HTML4.0", streamIDs[0], null, out encodingImage,out mimeTypeImage);
System.IO.FileStream fs = System.IO.File.OpenWrite(@."C:\Inetpub\wwwroot\GescomDllo\ImagenesTemporales\" + streamIDs[0]);
fs.Write(image, 0, Convert.ToInt32(image.Length));
fs.Close();
// store ReportingServices and parameters object is session layer in case we need it for image streams
Session["rs"] = rs;
Session["reportParameterValues"] = reportParameterValues2;
switch (format)
{
case"HTML4.0":
case"HTML3.2":
System.Text.Encoding enc = System.Text.Encoding.UTF8;
// get the report as a string
string tmpReport = enc.GetString(result);
// replace all occurrences of report server link with current page link
tmpReport = tmpReport.Replace(reportServerURL.Replace("/ReportService.asmx", "?"), ("http://"
+ (Request["SERVER_NAME"]
+ (Request["SCRIPT_NAME"] + "?Report="))));
ReportPlaceholder.InnerHtml = tmpReport;
break;
default:
Response.ClearContent();
Response.AppendHeader("content-length", result.Length.ToString());
Response.ContentType = mimeType;
Response.BinaryWrite(result);
Response.Flush();
Response.Close();
break;
}
}
}
|||Thanks buddy!!!
you answer helped me, though it was tough to figure out what i was doing wrong previosly. the only mistake i was doing is here .
it should be this.
image=rs.RenderStream("HTML4.0", streamID, null, out encodingImage, out mimeTypeImage);
i was doing this.
image=rs.RenderStream("IMAGE", streamID, null, out encodingImage, out mimeTypeImage);
Thanks again
|||
Luis Esteban, tendras ese mismo codigo pero para reporting services 2000?
Saludos
Images not being displayed.
1. I am using the webservice to render the images from a report, and they dont render.
I paste this URL to the browser
http://agamenon:90/ReportServer?%2fGescomRpts%2fRPT_MediosDesarrollo&rs%3aFormat=HTML4.0&rs:ImageID=6c809239-753f-4988-abcf-231416dff0d6
and I get this
No se encuentra la secuencia. No se encuentra el identificador de secuencia proporcionado a una operación en la base de datos del servidor de informes. (rsStreamNotFound) Obtener ayuda en pantalla
This is the code
the problem is that I need to know the streamid, and to know the streamid I first have to render the report where the image is to be placed.
This is the page getimage.aspx
protected void Page_Load(object sender, EventArgs e)
{
string reportPath = Server.UrlDecode(Request["report"]);
//string streamID = Request["streamid"];
ReportExecutionService rs = (ReportExecutionService)Session["rs"];
DataSourceCredentials[] credentials = null;
string showHideToggle = null;
string encoding;
string mimeType;
string extension;
Warning[] warnings = null;
ParameterValue[] reportHistoryParameters = null;
string historyID = null;
string[] streamIDs = null;
ServerInfoHeader sh = new ServerInfoHeader();
rs.ServerInfoHeaderValue = sh;
byte[] result = null;
ParameterValue[] reportParameterValues2 = null;
string deviceInfo = "<DeviceInfo>" +
//"<StreamRoot>" + streamRoot + "</StreamRoot>" +
"<Toolbar>False</Toolbar>" +
"<Parameters>False</Parameters>" +
"<HTMLFragment>True</HTMLFragment>" +
"<StyleStream>False</StyleStream>" +
"<Section>0</Section>" +
"<Zoom>" +
"</Zoom>" +
"</DeviceInfo>";
result = rs.Render("HTML4.0", deviceInfo, out extension, out mimeType, out encoding, out warnings, out streamIDs);
string streamID = streamIDs[0];
string encodingImage;
string mimeTypeImage;
byte[] image;
ParameterValue[] pv = (ParameterValue[])Session["reportParameterValues"];
//image = rs.RenderStream(reportPath, "HTML4.0", streamID, null, null, pv, out encodingImage, out mimeTypeImage);
image=rs.RenderStream("HTML4.0", streamID, null, out encodingImage, out mimeTypeImage);
Response.Clear();
Response.ContentType = mimeTypeImage;
Response.AppendHeader("content-length", image.Length.ToString());
Response.BinaryWrite(image);
Response.Flush();
Response.Close();
}
and this is the page of the report. Sorry for the long code.
if (reportCanBeRendered)
{
string deviceInfo;
string streamRoot;
Session["rs"] = rs;
streamRoot = ("getimage.aspx?report="+ (path + "&streamid="));
switch (format)
{
case "HTML4.0":
case "HTML3.2":
deviceInfo = "<DeviceInfo>" +
"<StreamRoot></StreamRoot>" +
"<Toolbar>False</Toolbar>" +
"<Parameters>False</Parameters>" +
"<HTMLFragment>True</HTMLFragment>" +
"<StyleStream>False</StyleStream>" +
"<Section>0</Section>" +
"<Zoom>" +
"</Zoom>" +
"</DeviceInfo>";
break;
default:
deviceInfo = "<DeviceInfo></DeviceInfo>";
break;
}
// SQLRS-ReportViewer
if (!(reportParameterValues == null))
{
//reportParameterValues2 = reportParameterValues.ToArray(typeof(ParameterValue));
//reportParameterValues2 = (ParameterValue[])reportParameterValues.ToArray(typeof(ParameterValue));
}
DataSourceCredentials[] credentials = null;
string showHideToggle = null;
string encoding;
string mimeType;
string extension;
Warning[] warnings = null;
ParameterValue[] reportHistoryParameters = null;
string historyID = null;
string[] streamIDs = null;
ServerInfoHeader sh = new ServerInfoHeader();
rs.ServerInfoHeaderValue = sh;
byte[] result = null;
ParameterValue[] reportParameterValues2 = null;
result = rs.Render(format, deviceInfo, out extension, out mimeType, out encoding, out warnings, out streamIDs);
streamRoot = "getimage.aspx?report=" + path + "&streamid=" + streamIDs[0];
//string reportPath2 = Server.UrlDecode(Request["report"]);
//string streamID = streamIDs[0];
////string streamID = "";
//ReportExecutionService rs2 = new ReportExecutionService();
//Session["rs"] = rs;
//rs2=(ReportExecutionService)Session["rs"];
//////ReportingService rs = (ReportingService)Session["rs"];
//string encodingImage;
//string mimeTypeImage;
//byte[] image;
//ParameterValue[] pv = (ParameterValue[])Session["reportParameterValues"];
//////image = rs.RenderStream(reportPath, "HTML4.0", streamID, null, null, pv, out encodingImage, out mimeTypeImage);
//image = rs2.RenderStream("HTML4.0", streamID, null, out encodingImage, out mimeTypeImage);
//Response.Clear();
//Response.ContentType = mimeTypeImage;
//Response.AppendHeader("content-length", image.Length.ToString());
//Response.BinaryWrite(image);
//Response.Flush();
//Response.Close();
// store ReportingServices and parameters object is session layer in case we need it for image streams
Session["rs"] = rs;
Session["reportParameterValues"] = reportParameterValues2;
switch (format)
{
case "HTML4.0":
case "HTML3.2":
System.Text.Encoding enc = System.Text.Encoding.UTF8;
// get the report as a string
string tmpReport = enc.GetString(result);
// replace all occurrences of report server link with current page link
tmpReport = tmpReport.Replace(reportServerURL.Replace("/ReportService.asmx", "?"), ("http://"
+ (Request["SERVER_NAME"]
+ (Request["SCRIPT_NAME"] + "?Report="))));
ReportPlaceholder.InnerHtml = tmpReport;
break;
default:
Response.ClearContent();
Response.AppendHeader("content-length", result.Length.ToString());
Response.ContentType = mimeType;
Response.BinaryWrite(result);
Response.Flush();
Response.Close();
break;
}
}
I actually solved the proble, this code has a little of garbage, but it began working.
private void GenerarInPlaceHTML()
{
string path = reportPath+ "RPT_MediosDesarrollo";
ReportExecutionService rs = new ReportExecutionService();
rs.Url = reportServerURL;
System.Net.NetworkCredential reportCredentials = new System.Net.NetworkCredential(reportUser, userPassword, domain);
rs.Credentials = reportCredentials;
// see if Report URL parameter is defined and if it is then consider that report
if (!(Request["Report"] == null))
{
reportPath = Request["Report"];
}
// set the Report hidden parameter
Report.Value = reportPath;
// Get the list of parameters. without specifing to render the report (ForRendering set to false)
// valid values for these parameters will not be populated
ExecutionInfo execInfo;
execInfo = rs.LoadReport(path, null);
ReportParameter[] reportParametersArray = execInfo.Parameters;
//reportParametersArray = rs.GetReportParameters(path, null, false, null, null);
//// If there are parametrs then we generate an array with values that should be populated from either
//// - previous submission ,
//// - URL parameters,
//// - default value defined inside the report
//// some usefull declarations
System.Web.UI.HtmlControls.HtmlTableRow TR = new HtmlTableRow();
System.Web.UI.HtmlControls.HtmlTableCell TD;
System.Web.UI.HtmlControls.HtmlSelect S;
System.Web.UI.WebControls.ListItem LI;
System.Web.UI.HtmlControls.HtmlInputText T;
//// hash table with dependecies
System.Collections.Hashtable Dependencies = new System.Collections.Hashtable();
//// we need a dynamic array for storing parameter values
ArrayList reportParameterValues= new ArrayList();
if (reportCanBeRendered)
{
string deviceInfo;
string streamRoot;
Session["rs"] = rs;
streamRoot = ("getimage.aspx?report="+ (path + "&streamid="));
switch (format)
{
case "HTML4.0":
case "HTML3.2":
deviceInfo = "<DeviceInfo>" +
"<StreamRoot>http://ImagenesTemporales/</StreamRoot>" +
"<Toolbar>False</Toolbar>" +
"<Parameters>False</Parameters>" +
"<HTMLFragment>True</HTMLFragment>" +
"<StyleStream>False</StyleStream>" +
"<Section>0</Section>" +
"<Zoom>" +
"</Zoom>" +
"</DeviceInfo>";
break;
default:
deviceInfo = "<DeviceInfo></DeviceInfo>";
break;
}
// SQLRS-ReportViewer
if (!(reportParameterValues == null))
{
//reportParameterValues2 = reportParameterValues.ToArray(typeof(ParameterValue));
//reportParameterValues2 = (ParameterValue[])reportParameterValues.ToArray(typeof(ParameterValue));
}
DataSourceCredentials[] credentials = null;
string showHideToggle = null;
string encoding;
string mimeType;
string extension;
Warning[] warnings = null;
ParameterValue[] reportHistoryParameters = null;
string historyID = null;
string[] streamIDs = null;
ServerInfoHeader sh = new ServerInfoHeader();
rs.ServerInfoHeaderValue = sh;
byte[] result = null;
ParameterValue[] reportParameterValues2 = null;
result = rs.Render(format, deviceInfo, out extension, out mimeType, out encoding, out warnings, out streamIDs);
string encodingImage;
string mimeTypeImage;
byte[] image = rs.RenderStream("HTML4.0", streamIDs[0], null, out encodingImage,out mimeTypeImage);
System.IO.FileStream fs = System.IO.File.OpenWrite(@."C:\Inetpub\wwwroot\GescomDllo\ImagenesTemporales\" + streamIDs[0]);
fs.Write(image, 0, Convert.ToInt32(image.Length));
fs.Close();
// store ReportingServices and parameters object is session layer in case we need it for image streams
Session["rs"] = rs;
Session["reportParameterValues"] = reportParameterValues2;
switch (format)
{
case "HTML4.0":
case "HTML3.2":
System.Text.Encoding enc = System.Text.Encoding.UTF8;
// get the report as a string
string tmpReport = enc.GetString(result);
// replace all occurrences of report server link with current page link
tmpReport = tmpReport.Replace(reportServerURL.Replace("/ReportService.asmx", "?"), ("http://"
+ (Request["SERVER_NAME"]
+ (Request["SCRIPT_NAME"] + "?Report="))));
ReportPlaceholder.InnerHtml = tmpReport;
break;
default:
Response.ClearContent();
Response.AppendHeader("content-length", result.Length.ToString());
Response.ContentType = mimeType;
Response.BinaryWrite(result);
Response.Flush();
Response.Close();
break;
}
}
}
|||Thanks buddy!!!
you answer helped me, though it was tough to figure out what i was doing wrong previosly. the only mistake i was doing is here .
it should be this.
image=rs.RenderStream("HTML4.0", streamID, null, out encodingImage, out mimeTypeImage);
i was doing this.
image=rs.RenderStream("IMAGE", streamID, null, out encodingImage, out mimeTypeImage);
Thanks again
|||
Luis Esteban, tendras ese mismo codigo pero para reporting services 2000?
Saludos
sql
images loading slow corrupts the report
also has a report that it drills down to. This page that calls this report
uses the reportviewer. the report loads quick, but the images take a while
longer. If I hit the column that drills to the next report, I can see the
page call the server, but the report stays on the same page. Yet the
reportviewer showbackbutton becomes active. If you hit the backbutton on
the reportviewer, it errors with Execution 'v0v2zx550yizfieksuf1ya45' cannot
be found .
How do I get the images quicker?
How do I keep the above problem from happening?On Jul 5, 5:32 pm, NeedToKnow <NeedToK...@.newsgroups.nospam> wrote:
> I have a report with an embedded image which appears in every row(static), it
> also has a report that it drills down to. This page that calls this report
> uses the reportviewer. the report loads quick, but the images take a while
> longer. If I hit the column that drills to the next report, I can see the
> page call the server, but the report stays on the same page. Yet the
> reportviewer showbackbutton becomes active. If you hit the backbutton on
> the reportviewer, it errors with Execution 'v0v2zx550yizfieksuf1ya45' cannot
> be found .
> How do I get the images quicker?
> How do I keep the above problem from happening?
It seems like you are using too many resources while trying to render
several images. If your images are MPEG, I would suggest converting
them to JPG/JPEG/GIF which should conserve space and improve
performance a little. It seems from your description that the
execution error is related to the resource utilization (of the
rendering). Sorry that I could not be of greater assistance.
Regards,
Enrique Martinez
Sr. Software Consultant|||My resource is one gif that is 925 bytes in size. It appears on every line
of the table. It is not a resource error. It comes from the reportviewer
when it is trying to load the drill down report.
"EMartinez" wrote:
> On Jul 5, 5:32 pm, NeedToKnow <NeedToK...@.newsgroups.nospam> wrote:
> > I have a report with an embedded image which appears in every row(static), it
> > also has a report that it drills down to. This page that calls this report
> > uses the reportviewer. the report loads quick, but the images take a while
> > longer. If I hit the column that drills to the next report, I can see the
> > page call the server, but the report stays on the same page. Yet the
> > reportviewer showbackbutton becomes active. If you hit the backbutton on
> > the reportviewer, it errors with Execution 'v0v2zx550yizfieksuf1ya45' cannot
> > be found .
> > How do I get the images quicker?
> > How do I keep the above problem from happening?
>
> It seems like you are using too many resources while trying to render
> several images. If your images are MPEG, I would suggest converting
> them to JPG/JPEG/GIF which should conserve space and improve
> performance a little. It seems from your description that the
> execution error is related to the resource utilization (of the
> rendering). Sorry that I could not be of greater assistance.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>
Images inside a literal
is OK, except the images are not displaying. Is there anything special
I have to do?
When using preview or the MS Sample Report Viewer Control, the images
appear.
I cannot use the Report Viewer Control as I need to pass XML to the
report, not a server side data source.
Can someone help?
Matt...As you probably know, there three types of getting imager into report:
1) From database â'it is not you case
2) Embedded into the report application
3) URL to the image â' this one you may try.
Regards, ProJester,
MSN Programmer.
"mtatro@.direcsoft.com" wrote:
> I am displaying the output from a Report inside a literal. Everything
> is OK, except the images are not displaying. Is there anything special
> I have to do?
> When using preview or the MS Sample Report Viewer Control, the images
> appear.
> I cannot use the Report Viewer Control as I need to pass XML to the
> report, not a server side data source.
> Can someone help?
> Matt...
>|||How can I get the Embedded option to work?
Matt...
Images in reports . . . .TIFs?
that this should be easy, the primary problem is the images are .tif . From
everything I am seeing .tifs do not appear to be supported. Is this the case
or am I selecting the wrong option somehow along the way? I find this odd as
Tifs seem to be very common!
The path to each image is stored in a field in my datavbase, so I am trying
to insert the path to the image somewhere in my images properties.
Thanks in advance.I had the almost same problem like you. Actually RS2000 doesn't support to
show Tiff format images in a report, just export is ok. In my case, I created
a web app to convert tiff to jpg, and then used external source to get images
from the web developed. Maybe it'll be fixed later.
Dave
"Rick" wrote:
> I am trying to embed images within the detail line of my report. It appearse
> that this should be easy, the primary problem is the images are .tif . From
> everything I am seeing .tifs do not appear to be supported. Is this the case
> or am I selecting the wrong option somehow along the way? I find this odd as
> Tifs seem to be very common!
> The path to each image is stored in a field in my datavbase, so I am trying
> to insert the path to the image somewhere in my images properties.
> Thanks in advance.|||Actually in rereading I am NOT trying to imbed, but it does not appear to
make a difference.
I am trying to link them to an image control dynamically.
Unfortunately a report could contain THOUSANDS of tifs. Converting them to
jpg's or something else compatable would not be a viable option. I can do
what I need to do in Crystal, but I wanted to keep all of my reporting
together in one interface. This is the only report that I can not do through
reporting services.
Rick
"Rick" wrote:
> I am trying to embed images within the detail line of my report. It appearse
> that this should be easy, the primary problem is the images are .tif . From
> everything I am seeing .tifs do not appear to be supported. Is this the case
> or am I selecting the wrong option somehow along the way? I find this odd as
> Tifs seem to be very common!
> The path to each image is stored in a field in my datavbase, so I am trying
> to insert the path to the image somewhere in my images properties.
> Thanks in advance.
Images in Reporting Services from database
I have a data table which contains a bmp image saved as a byte array. I am trying to have this image presented in a report, however, I get a red X after I follow the wizard.
I also tried it with the SQL Northwind database and I have the same issue. I am running SQL Reporting services 2005. Any suggestions on what could be going wrong?
Joe
after placing the image you have select the image source i.e. database in your case and then you have select the field name which contains image and the MIME type as image/bmp or try image/png.
this should work
|||I have tried with both image/bmp and image/png on northwind DB as recommended. I still get red cross. Any ideal what's wrong?
|||I have tried with both image/bmp and image/png on northwind DB as recommended. I still get red cross. Any idea what's wrong?
|||Please read this RS BOL topic: http://msdn2.microsoft.com/en-us/library/ms156342(SQL.90).aspxParticularly read the comment near the top if the images came originally from an Access database, because in that case the actual image data is an OLE image and you have to write an expression to remove the OLE image header from the data. This also applies to the Northwind sample database.
Furthermore, I recommend to install SQL Server 2005 SP1 for Reporting Services.
-- Robert
sqlImages in Reporting Services from database
I have a data table which contains a bmp image saved as a byte array. I am trying to have this image presented in a report, however, I get a red X after I follow the wizard.
I also tried it with the SQL Northwind database and I have the same issue. I am running SQL Reporting services 2005. Any suggestions on what could be going wrong?
Joe
after placing the image you have select the image source i.e. database in your case and then you have select the field name which contains image and the MIME type as image/bmp or try image/png.
this should work
|||I have tried with both image/bmp and image/png on northwind DB as recommended. I still get red cross. Any ideal what's wrong?
|||I have tried with both image/bmp and image/png on northwind DB as recommended. I still get red cross. Any idea what's wrong?
|||Please read this RS BOL topic: http://msdn2.microsoft.com/en-us/library/ms156342(SQL.90).aspxParticularly read the comment near the top if the images came originally from an Access database, because in that case the actual image data is an OLE image and you have to write an expression to remove the OLE image header from the data. This also applies to the Northwind sample database.
Furthermore, I recommend to install SQL Server 2005 SP1 for Reporting Services.
-- Robert