Showing posts with label displayed. Show all posts
Showing posts with label displayed. Show all posts

Wednesday, March 28, 2012

Images Not Displayed On Server

Ok maybe someone here can help me with this. I have a crystal report with both static images (images dragged onto the report in the designer) and images that are pulled and inserted into the report as BLOBs.

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 + "&amp;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 + "&amp;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 + "&amp;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

Monday, March 26, 2012

Images aren't being displayed in deployed Reports

Hi everybody,

When I develop and run (preview) a report in my machine (Vs.net 2003), the report is displayed correctly, including images.

But, when I deploy the report to the server (Win2k Server), the report runs OK, but the images are not displayed! Tongue Tied

I've already tried everything I found in the internet about this problem .... changed the way of put the image in the report (Embedded, External), tried an image with only RGB colors, changed the account for unattended execution (rsconfig) .... but nothing worked!!!

Does anybody have any idea about what might be happening?

Thanks a lot!!Make sure cookies are enabled in your browser. Images rely on sessions and sessions rely on cookies.

To better diagnose this you can right click on the missing image icon right after rendering report, go to properties and copy link for the image. Make sure you copy the entire link. Then paste it in the address bar of the same window that displays report. You'll see better error message.|||Yes, cookies are enabled.

Actually, view the properties of the image was the first step I took ...

The image link:
http://server/ReportServer?%2fOpexReports%2fReport1&rs%3aFormat=HTML4.0&rs%3aImageID=6b02dc52-73b7-489e-8dfe-730e6d9bfd6b

when I copy the link in IE, I get this error:

Reporting Services Error

The stream cannot be found. The stream identifier that is provided to an operation cannot be located in the report server database. (rsStreamNotFound) Get Online Help|||I SOLVED THE PROBLEM!!

I discovered that images in report rendering rely on session and cookies.
When you have and underscore "_" in the server name, this may cause some session problems.

So I update the field UseSessionCookies to 'False' in the ConfigurationInfo table, in the RS Database. The images are now displayed! Big Smile

Regards!|||

Hi Rodrigo,

I am also facing the problem similar to your problem. I have followed your approach for solution, but unfortunately i am not able to get the solution.

Can you please provide me some approach for solving this problem

Regards,

Vikas Khandpur

|||

Just change the IP address to the computer name and it will work

Images aren't being displayed in deployed Reports

Hi everybody,

When I develop and run (preview) a report in my machine (Vs.net 2003), the report is displayed correctly, including images.

But, when I deploy the report to the server (Win2k Server), the report runs OK, but the images are not displayed! Tongue Tied

I've already tried everything I found in the internet about this problem .... changed the way of put the image in the report (Embedded, External), tried an image with only RGB colors, changed the account for unattended execution (rsconfig) .... but nothing worked!!!

Does anybody have any idea about what might be happening?

Thanks a lot!!Make sure cookies are enabled in your browser. Images rely on sessions and sessions rely on cookies.

To better diagnose this you can right click on the missing image icon right after rendering report, go to properties and copy link for the image. Make sure you copy the entire link. Then paste it in the address bar of the same window that displays report. You'll see better error message.|||Yes, cookies are enabled.

Actually, view the properties of the image was the first step I took ...

The image link:
http://server/ReportServer?%2fOpexReports%2fReport1&rs%3aFormat=HTML4.0&rs%3aImageID=6b02dc52-73b7-489e-8dfe-730e6d9bfd6b

when I copy the link in IE, I get this error:

Reporting Services Error

The stream cannot be found. The stream identifier that is provided to an operation cannot be located in the report server database. (rsStreamNotFound) Get Online Help|||I SOLVED THE PROBLEM!!

I discovered that images in report rendering rely on session and cookies.
When you have and underscore "_" in the server name, this may cause some session problems.

So I update the field UseSessionCookies to 'False' in the ConfigurationInfo table, in the RS Database. The images are now displayed! Big Smile

Regards!|||

Hi Rodrigo,

I am also facing the problem similar to your problem. I have followed your approach for solution, but unfortunately i am not able to get the solution.

Can you please provide me some approach for solving this problem

Regards,

Vikas Khandpur

|||

Just change the IP address to the computer name and it will work

Images aren't being displayed in deployed Reports

Hi everybody,

When I develop and run (preview) a report in my machine (Vs.net 2003), the report is displayed correctly, including images.

But, when I deploy the report to the server (Win2k Server), the report runs OK, but the images are not displayed! Tongue Tied

I've already tried everything I found in the internet about this problem .... changed the way of put the image in the report (Embedded, External), tried an image with only RGB colors, changed the account for unattended execution (rsconfig) .... but nothing worked!!!

Does anybody have any idea about what might be happening?

Thanks a lot!!Make sure cookies are enabled in your browser. Images rely on sessions and sessions rely on cookies.

To better diagnose this you can right click on the missing image icon right after rendering report, go to properties and copy link for the image. Make sure you copy the entire link. Then paste it in the address bar of the same window that displays report. You'll see better error message.|||Yes, cookies are enabled.

Actually, view the properties of the image was the first step I took ...

The image link:
http://server/ReportServer?%2fOpexReports%2fReport1&rs%3aFormat=HTML4.0&rs%3aImageID=6b02dc52-73b7-489e-8dfe-730e6d9bfd6b

when I copy the link in IE, I get this error:

Reporting Services Error

The stream cannot be found. The stream identifier that is provided to an operation cannot be located in the report server database. (rsStreamNotFound) Get Online Help|||I SOLVED THE PROBLEM!!

I discovered that images in report rendering rely on session and cookies.
When you have and underscore "_" in the server name, this may cause some session problems.

So I update the field UseSessionCookies to 'False' in the ConfigurationInfo table, in the RS Database. The images are now displayed! Big Smile

Regards!|||

Hi Rodrigo,

I am also facing the problem similar to your problem. I have followed your approach for solution, but unfortunately i am not able to get the solution.

Can you please provide me some approach for solving this problem

Regards,

Vikas Khandpur

|||

Just change the IP address to the computer name and it will work

Images :: Next, Previous, First, Last Functionality

currently have my website that is functional...but would like to add some navigation to my photos which are displayed using a repeater tied to a SQL database. (live example can be viewed here)

the above link shows a gallery page that displays all the photos within a given shoot (using a querystring to display the unique ID of the photo shoot). When you click on one of the images within the shoot a page called is called displaying the selected photo by passing the shoot ID and the unique ID of the photo itself through a querystring.

I would like to add navigation to the page displaying the photo that would allow the user to go to the next photo, previous photo, first and last phot within the specific SHOOT ID.

First
Next
Previous
Last

I am using a repeater to display the photo with the following sqlDataSource:

<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:Connection %>"
SelectCommand="
SELECT usr_Photos.*, usr_PhotoShoot.*
FROM usr_Photos
INNER JOIN usr_PhotoShoot ON usr_Photos.Shoot_ID = usr_PhotoShoot.Shoot_ID
WHERE usr_Photos.Photo_ID = @.ID AND usr_Photos.Shoot_ID = @.Shoot">

<SelectParameters>
<asp:QueryStringParameterDefaultValue=""Name="ID"QueryStringField="ID"/>
<asp:QueryStringParameterDefaultValue=""Name="Shoot"QueryStringField="Shoot"/>
</SelectParameters>

</asp:SqlDataSource>

I am having trouble figuring out a way to add the functionality i would need to change photos within the specific photo shoot without having to go back to the gallery page. any help or ideas you could point me in would be great...thanks in advance...

You need Datalist or Repeater Control Coustom Paging.

see the live view of what we created:

http://www.friendspoint.de/UsersWidPics.aspx

You will be able to find alot of material online for that. just google for "Datalist paging"

Did it help? If still not then i will try to post some Article.

|||

Ok, the Article is just finished. you can see it here now:

http://www.dotnet-friends.com/articles/asp/artinasp0cfb304d-42ea-4f8b-b480-9c047396252e.aspx

Friday, March 23, 2012

Image Not Displaying; SRC=""

I have a report server: DEV05
I have a web/data server: DEV14. It also has a SQL Server Database for
data to be displayed.
I have my pc: DEV01
IIS on the Report Server:
Reports ? anonymous is disabled
ReportServer ? anonymous is disabled
On the web server I have a virtual directory that houses images. From
a browser, on my machine I can see the image using:
http://dev14/images/sketcha.jpg. I can also see the image from the
report server using the same url.
When I'm designing a report in VS.NET on my machine and issue a new
image control and select ?web' as the source,
(http://dev14/images/sketcha.jpg.) the image is resolved.
However, when I deploy the report to the report server DEV05, and view
the report through report manager, the image (located on the web
server) is not displayed, a red X is displayed. The report data is
displayed though, which is stored in a SQL server on the same server
(DEV14).
The report uses a shared data Source. The data source uses stored
credentials to connect to the database on DEV14. The credentials are
SQL Logins, not NT.
Anyone have any suggestions on what permissions I need to change or
set so I can get the images to display?
All help and suggestions are greatly appreciated.
Thanks
Rwiethorn
rwiethorn@.remove-nospam-belcan.comRwiethorn,
How is dev14/images vroot configured?
Please note that when images are fetched by URL, a special unattended
execution Windows account is used.
From SP1 readme file:
"When the report is previewed in Report Designer, preview uses the
credentials of the user to display the image. When the report is run on the
report server, the report server uses the unattended execution account to
retrieve the image. If the unattended execution account is not specified,
the image is retrieved using no credentials (anonymous user account). If
either of these accounts have insufficient rights to access the image, the
image will not be displayed in the report. For more information about
setting the unattended execution account on the report server, see
"Configuring an Account for Unattended Report Processing" in Reporting
Services Books Online."
For more information check this thread: http://tinyurl.com/42738
Ii addition, check the "Configuring an Account for Unattended Report
Processing" topic in BOL.
--
Hope this helps.
----
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com : http://tinyurl.com/3l49j
Home page and blog: http://www.prologika.com/
----
"rwiethorn" <rwiethorn2002@.yahoo.com> wrote in message
news:553a0349.0408260649.70d95c7c@.posting.google.com...
> I have a report server: DEV05
> I have a web/data server: DEV14. It also has a SQL Server Database for
> data to be displayed.
> I have my pc: DEV01
> IIS on the Report Server:
> Reports - anonymous is disabled
> ReportServer - anonymous is disabled
>
> On the web server I have a virtual directory that houses images. From
> a browser, on my machine I can see the image using:
> http://dev14/images/sketcha.jpg. I can also see the image from the
> report server using the same url.
> When I'm designing a report in VS.NET on my machine and issue a new
> image control and select 'web' as the source,
> (http://dev14/images/sketcha.jpg.) the image is resolved.
> However, when I deploy the report to the report server DEV05, and view
> the report through report manager, the image (located on the web
> server) is not displayed, a red X is displayed. The report data is
> displayed though, which is stored in a SQL server on the same server
> (DEV14).
> The report uses a shared data Source. The data source uses stored
> credentials to connect to the database on DEV14. The credentials are
> SQL Logins, not NT.
> Anyone have any suggestions on what permissions I need to change or
> set so I can get the images to display?
> All help and suggestions are greatly appreciated.
> Thanks
> Rwiethorn
> rwiethorn@.remove-nospam-belcan.com

Image not displayed while doing Subscriptions

Hi,

I have scheduled subscriptions for a report which has an image in it.

The report is subscribed to be saved in a Report Server File Share in HTML format.

When i open the saved report i see a placeholder x instead of the image.

When i change the subscription format to ADOBE pdf it works fine.

Has anyone faced this problem ?

Any help on this is appreciated.

Thanks

Sam

Out-of-the-box file share delivery extension does not support saving all files for HTML (including images) into targeted share. You need to use MHTML format that allows embedding images (as MIME structures) within the report HTML.|||

Hey

Thanks. I changed it to Web Archive format and it renders them fine.

Just another question. Is there any doc on the internet which explains as to why Reporting Services does not support this out of the box.

THanks

Sam

|||I’m afraid this was not explicitly documented (I can't find such a doc) but I guess it was an intentional decision not to support this. Otherwise if delivery consists of more than 1 file than delivery should handle all cases related to file write operations (permissions, overwriting, file size, etc) for all files in a delivery which makes it more complicated and fragile.|||Thank you so much for all your help on this.

Image not displayed in report

Hello everyone,

I have a Reporting Services report which must show photographs stored in a SQL Server database. The trouble is that the photos just don't display. The report just shows the little red cross icon.

When I use MS-Access forms and reports it works fine. But I need this to work with Reporting Services!

Help please!

Jerome

What data type are the pictures stored in SQL DB? You may want to change the MIMEType of the Image control on your report to see if which one is correct. I've been using image/bmp to accommodate pictures stored as varbinary data type. HTH.|||

Hi.

I discovered that the problem has to do with the way Access stores images. It stores all the OLE data necessary to display the images in Access, but this is not compatible with SQL Server. I solved the problem by purchasing and installing DBPix software. It cost me US$ 100.

Cheers,

Jerome

|||

Technet has an article about how to access OLE images. See the section entitled 'Task List Item 2 – Database Images' in http://www.microsoft.com/technet/prodtechnol/sql/2000/deploy/migratereports.mspx. Note that the code as presented only works for OLE images created on an en-US system:

Code Snippet

=System.Convert.FromBase64String(Mid(System.Convert.ToBase64String(Fields.Picture.Value),105))

For images created on other locales, check out this post: http://forums.devarticles.com/showpost.php?p=51707&postcount=3.

Thanks.

Image not displayed in report

Hello everyone,

I have a Reporting Services report which must show photographs stored in a SQL Server database. The trouble is that the photos just don't display. The report just shows the little red cross icon.

When I use MS-Access forms and reports it works fine. But I need this to work with Reporting Services!

Help please!

Jerome

What data type are the pictures stored in SQL DB? You may want to change the MIMEType of the Image control on your report to see if which one is correct. I've been using image/bmp to accommodate pictures stored as varbinary data type. HTH.|||

Hi.

I discovered that the problem has to do with the way Access stores images. It stores all the OLE data necessary to display the images in Access, but this is not compatible with SQL Server. I solved the problem by purchasing and installing DBPix software. It cost me US$ 100.

Cheers,

Jerome

|||

Technet has an article about how to access OLE images. See the section entitled 'Task List Item 2 – Database Images' in http://www.microsoft.com/technet/prodtechnol/sql/2000/deploy/migratereports.mspx. Note that the code as presented only works for OLE images created on an en-US system:

Code Snippet

=System.Convert.FromBase64String(Mid(System.Convert.ToBase64String(Fields.Picture.Value),105))

For images created on other locales, check out this post: http://forums.devarticles.com/showpost.php?p=51707&postcount=3.

Thanks.

Image not displayed in report

I am creating a very simple report in VS 2005. I dragged an image
control to the report surface and set it's value property to the
virtual path of my image (like "~/SubPage/Trademark.jpg"). However,
the image is never displayed - either at design time, when the report
viewer runs, or when the report is exported to PDF. I just get the
standard "No image" (red X) icon.
I have read other posts about this but most of them were trying to do
something more complicated than me. At this point, I am not trying to
do any logic for the visibility or the value it is trying to display.
I read about a bug that might be related here:
http://support.microsoft.com/kb/842537/
...but I am not sure if this pertains to me (as I am not pointing to a
URL, but rather a virtual path). I am leery of applying this SP2
patch, as there is no way to uninstall it, and I am not sure if it
will "break" anything that is currently working.
I would appreciate any suggestions that anyone could give me.
Thank you!Kirk,
Try embedding the image into the report instead of using the URL.
MM
"Kirk" wrote:
> I am creating a very simple report in VS 2005. I dragged an image
> control to the report surface and set it's value property to the
> virtual path of my image (like "~/SubPage/Trademark.jpg"). However,
> the image is never displayed - either at design time, when the report
> viewer runs, or when the report is exported to PDF. I just get the
> standard "No image" (red X) icon.
> I have read other posts about this but most of them were trying to do
> something more complicated than me. At this point, I am not trying to
> do any logic for the visibility or the value it is trying to display.
> I read about a bug that might be related here:
> http://support.microsoft.com/kb/842537/
> ...but I am not sure if this pertains to me (as I am not pointing to a
> URL, but rather a virtual path). I am leery of applying this SP2
> patch, as there is no way to uninstall it, and I am not sure if it
> will "break" anything that is currently working.
> I would appreciate any suggestions that anyone could give me.
> Thank you!
>|||I´ve also tested what you say and it does not work with relative path.
To make it work, do what Marie says or use absolute URL
(http://www.yourpage.com/Subpage/Trademark.jpg)
"Kirk" <loki70@.hotmail.com> escribió en el mensaje
news:1193753651.198915.166370@.k79g2000hse.googlegroups.com...
>I am creating a very simple report in VS 2005. I dragged an image
> control to the report surface and set it's value property to the
> virtual path of my image (like "~/SubPage/Trademark.jpg"). However,
> the image is never displayed - either at design time, when the report
> viewer runs, or when the report is exported to PDF. I just get the
> standard "No image" (red X) icon.
> I have read other posts about this but most of them were trying to do
> something more complicated than me. At this point, I am not trying to
> do any logic for the visibility or the value it is trying to display.
> I read about a bug that might be related here:
> http://support.microsoft.com/kb/842537/
> ...but I am not sure if this pertains to me (as I am not pointing to a
> URL, but rather a virtual path). I am leery of applying this SP2
> patch, as there is no way to uninstall it, and I am not sure if it
> will "break" anything that is currently working.
> I would appreciate any suggestions that anyone could give me.
> Thank you!
>|||On Oct 31, 12:21 pm, "M=F3nica" <monica.d...@.augure.com> wrote:
> I=B4ve also tested what you say and it does not work with relative path.
> To make it work, do what Marie says or use absolute URL
> (http://www.yourpage.com/Subpage/Trademark.jpg)
> "Kirk" <lok...@.hotmail.com> escribi=F3 en el mensajenews:1193753651.19891=5=2E166370@.k79g2000hse.googlegroups.com...
>
> >I am creating a very simple report in VS 2005. I dragged an image
> > control to the report surface and set it's value property to the
> > virtual path of my image (like "~/SubPage/Trademark.jpg"). However,
> > the image is never displayed - either at design time, when the report
> > viewer runs, or when the report is exported to PDF. I just get the
> > standard "No image" (red X) icon.
> > I have read other posts about this but most of them were trying to do
> > something more complicated than me. At this point, I am not trying to
> > do any logic for the visibility or the value it is trying to display.
> > I read about a bug that might be related here:
> >http://support.microsoft.com/kb/842537/
> > ...but I am not sure if this pertains to me (as I am not pointing to a
> > URL, but rather a virtual path). I am leery of applying this SP2
> > patch, as there is no way to uninstall it, and I am not sure if it
> > will "break" anything that is currently working.
> > I would appreciate any suggestions that anyone could give me.
> > Thank you!- Hide quoted text -
> - Show quoted text -
Thanks for the replies. I used the absolute URL and that worked.
It's unfortunate that this does not work with a relative path.
Obviously, thing change (and move around on servers) and having to
update the application just to update absolute URL's is goofy. I
know, I know, you can add this as a configuration setting so that you
don't have to rebuild the site - I was just whining.
Thanks again!

Monday, March 19, 2012

Image and text values not displayed in header or footer

I have a report in which I need to display an Image in the header, that is
coming from Database or sometimes an alternative text in place of the image.
Both ways I couldn't do it.
Case Text: I have tried several ways such as using ReportItem Parameters,
but the problem is the text is displayed in the first page of a group. If the
group region needs morethan one page when the report is rendered then the
next pages will not have the header or footer text.
Case Image: No means at all!!!!!
Is there any way of achieving this? Please help ...
--
GoitThere is an option on the Grouping and Sorting Properties dialog to repeat
group headers/footers. If you select the checkbox, the group header will be
repeated and hence the referenced reportitem value will show up in page
header/footer.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Goitom" <Goitom@.discussions.microsoft.com> wrote in message
news:D4AB0430-7F67-4CC1-BDE2-4B29E7254F48@.microsoft.com...
>I have a report in which I need to display an Image in the header, that is
> coming from Database or sometimes an alternative text in place of the
> image.
> Both ways I couldn't do it.
> Case Text: I have tried several ways such as using ReportItem Parameters,
> but the problem is the text is displayed in the first page of a group. If
> the
> group region needs morethan one page when the report is rendered then the
> next pages will not have the header or footer text.
> Case Image: No means at all!!!!!
> Is there any way of achieving this? Please help ...
> --
> Goit|||Thanks Robert,
You are right, I will check this out but how about the image? Your solution
could be used only for the case of text field. But still I am not able to
display an image logo in the header of the report that needs to be repeated
in all the pages and its source is database
Goit
"Robert Bruckner [MSFT]" wrote:
> There is an option on the Grouping and Sorting Properties dialog to repeat
> group headers/footers. If you select the checkbox, the group header will be
> repeated and hence the referenced reportitem value will show up in page
> header/footer.
>
> -- Robert
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Goitom" <Goitom@.discussions.microsoft.com> wrote in message
> news:D4AB0430-7F67-4CC1-BDE2-4B29E7254F48@.microsoft.com...
> >I have a report in which I need to display an Image in the header, that is
> > coming from Database or sometimes an alternative text in place of the
> > image.
> > Both ways I couldn't do it.
> > Case Text: I have tried several ways such as using ReportItem Parameters,
> > but the problem is the text is displayed in the first page of a group. If
> > the
> > group region needs morethan one page when the report is rendered then the
> > next pages will not have the header or footer text.
> >
> > Case Image: No means at all!!!!!
> >
> > Is there any way of achieving this? Please help ...
> > --
> > Goit
>
>|||It sounds like you want the same image to show up in the header of every
page. There are several options to achieve this:
* use an "embedded" image in the report. This works well if the image is
e.g. a company logo.
* use a "project" image which is part of the report solution. The image will
get published as resource to the report server
* use a "web" image (aka external image) - which requires at least RS 2000
SP1.
If you really need the image to come from the database, you can do the
following:
* add a dataset DImage to the report which retrieves the image data - e.g.
as ImageData column.
* add a new report parameter PImage of type String. Make the parameter
hidden (non-prompted). Set the parameter default as query-based and choose
ImageData as column.
* add a new Image report item in the page header/footer. Set the image type
to "Database". For the image value expression use =Parameters!PImage.Value.
Don't forget the set the mimetype correctly.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Goitom" <Goitom@.discussions.microsoft.com> wrote in message
news:F071F4C7-08AD-4654-911C-32DA43EA3441@.microsoft.com...
> Thanks Robert,
> You are right, I will check this out but how about the image? Your
> solution
> could be used only for the case of text field. But still I am not able to
> display an image logo in the header of the report that needs to be
> repeated
> in all the pages and its source is database
>
> --
> Goit
>
> "Robert Bruckner [MSFT]" wrote:
>> There is an option on the Grouping and Sorting Properties dialog to
>> repeat
>> group headers/footers. If you select the checkbox, the group header will
>> be
>> repeated and hence the referenced reportitem value will show up in page
>> header/footer.
>>
>> -- Robert
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> "Goitom" <Goitom@.discussions.microsoft.com> wrote in message
>> news:D4AB0430-7F67-4CC1-BDE2-4B29E7254F48@.microsoft.com...
>> >I have a report in which I need to display an Image in the header, that
>> >is
>> > coming from Database or sometimes an alternative text in place of the
>> > image.
>> > Both ways I couldn't do it.
>> > Case Text: I have tried several ways such as using ReportItem
>> > Parameters,
>> > but the problem is the text is displayed in the first page of a group.
>> > If
>> > the
>> > group region needs morethan one page when the report is rendered then
>> > the
>> > next pages will not have the header or footer text.
>> >
>> > Case Image: No means at all!!!!!
>> >
>> > Is there any way of achieving this? Please help ...
>> > --
>> > Goit
>>|||Thanks a lot, I have tried this approach several times with different
techiniques but the end result is that the image box control shows the no
image icon.
--
Goit
"Robert Bruckner [MSFT]" wrote:
> It sounds like you want the same image to show up in the header of every
> page. There are several options to achieve this:
> * use an "embedded" image in the report. This works well if the image is
> e.g. a company logo.
> * use a "project" image which is part of the report solution. The image will
> get published as resource to the report server
> * use a "web" image (aka external image) - which requires at least RS 2000
> SP1.
> If you really need the image to come from the database, you can do the
> following:
> * add a dataset DImage to the report which retrieves the image data - e.g.
> as ImageData column.
> * add a new report parameter PImage of type String. Make the parameter
> hidden (non-prompted). Set the parameter default as query-based and choose
> ImageData as column.
> * add a new Image report item in the page header/footer. Set the image type
> to "Database". For the image value expression use =Parameters!PImage.Value.
> Don't forget the set the mimetype correctly.
>
> -- Robert
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Goitom" <Goitom@.discussions.microsoft.com> wrote in message
> news:F071F4C7-08AD-4654-911C-32DA43EA3441@.microsoft.com...
> > Thanks Robert,
> >
> > You are right, I will check this out but how about the image? Your
> > solution
> > could be used only for the case of text field. But still I am not able to
> > display an image logo in the header of the report that needs to be
> > repeated
> > in all the pages and its source is database
> >
> >
> > --
> > Goit
> >
> >
> > "Robert Bruckner [MSFT]" wrote:
> >
> >> There is an option on the Grouping and Sorting Properties dialog to
> >> repeat
> >> group headers/footers. If you select the checkbox, the group header will
> >> be
> >> repeated and hence the referenced reportitem value will show up in page
> >> header/footer.
> >>
> >>
> >> -- Robert
> >> This posting is provided "AS IS" with no warranties, and confers no
> >> rights.
> >>
> >>
> >> "Goitom" <Goitom@.discussions.microsoft.com> wrote in message
> >> news:D4AB0430-7F67-4CC1-BDE2-4B29E7254F48@.microsoft.com...
> >> >I have a report in which I need to display an Image in the header, that
> >> >is
> >> > coming from Database or sometimes an alternative text in place of the
> >> > image.
> >> > Both ways I couldn't do it.
> >> > Case Text: I have tried several ways such as using ReportItem
> >> > Parameters,
> >> > but the problem is the text is displayed in the first page of a group.
> >> > If
> >> > the
> >> > group region needs morethan one page when the report is rendered then
> >> > the
> >> > next pages will not have the header or footer text.
> >> >
> >> > Case Image: No means at all!!!!!
> >> >
> >> > Is there any way of achieving this? Please help ...
> >> > --
> >> > Goit
> >>
> >>
> >>
>
>|||Are you sure the image is really stored as image in the database (rather
than being stored as OLE image, which for instance Access would do)?
If it is stored as OLE image, you have to get rid of the OLE header. If the
bitmap was created on an English system, the OLE header is 78 bytes (e.g. on
Spanish it would be 88 bytes). Use the following image value expression to
make the image show up (79 == header length + 1):
=System.Text.Encoding.Default.GetBytes(Mid(System.Text.Encoding.Default.GetString(Fields!Picture.Value),79))
Alternatively, you can use the following expression (which only works for
images created on an en-US system!):
=System.Convert.FromBase64String(Mid(System.Convert.ToBase64String(Fields!Picture.Value),105))
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Goitom" <Goitom@.discussions.microsoft.com> wrote in message
news:ED81ACCF-9D9E-4E4A-9A58-2A6485E338D9@.microsoft.com...
> Thanks a lot, I have tried this approach several times with different
> techiniques but the end result is that the image box control shows the no
> image icon.
> --
> Goit
>
> "Robert Bruckner [MSFT]" wrote:
>> It sounds like you want the same image to show up in the header of every
>> page. There are several options to achieve this:
>> * use an "embedded" image in the report. This works well if the image is
>> e.g. a company logo.
>> * use a "project" image which is part of the report solution. The image
>> will
>> get published as resource to the report server
>> * use a "web" image (aka external image) - which requires at least RS
>> 2000
>> SP1.
>> If you really need the image to come from the database, you can do the
>> following:
>> * add a dataset DImage to the report which retrieves the image data -
>> e.g.
>> as ImageData column.
>> * add a new report parameter PImage of type String. Make the parameter
>> hidden (non-prompted). Set the parameter default as query-based and
>> choose
>> ImageData as column.
>> * add a new Image report item in the page header/footer. Set the image
>> type
>> to "Database". For the image value expression use
>> =Parameters!PImage.Value.
>> Don't forget the set the mimetype correctly.
>>
>> -- Robert
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> "Goitom" <Goitom@.discussions.microsoft.com> wrote in message
>> news:F071F4C7-08AD-4654-911C-32DA43EA3441@.microsoft.com...
>> > Thanks Robert,
>> >
>> > You are right, I will check this out but how about the image? Your
>> > solution
>> > could be used only for the case of text field. But still I am not able
>> > to
>> > display an image logo in the header of the report that needs to be
>> > repeated
>> > in all the pages and its source is database
>> >
>> >
>> > --
>> > Goit
>> >
>> >
>> > "Robert Bruckner [MSFT]" wrote:
>> >
>> >> There is an option on the Grouping and Sorting Properties dialog to
>> >> repeat
>> >> group headers/footers. If you select the checkbox, the group header
>> >> will
>> >> be
>> >> repeated and hence the referenced reportitem value will show up in
>> >> page
>> >> header/footer.
>> >>
>> >>
>> >> -- Robert
>> >> This posting is provided "AS IS" with no warranties, and confers no
>> >> rights.
>> >>
>> >>
>> >> "Goitom" <Goitom@.discussions.microsoft.com> wrote in message
>> >> news:D4AB0430-7F67-4CC1-BDE2-4B29E7254F48@.microsoft.com...
>> >> >I have a report in which I need to display an Image in the header,
>> >> >that
>> >> >is
>> >> > coming from Database or sometimes an alternative text in place of
>> >> > the
>> >> > image.
>> >> > Both ways I couldn't do it.
>> >> > Case Text: I have tried several ways such as using ReportItem
>> >> > Parameters,
>> >> > but the problem is the text is displayed in the first page of a
>> >> > group.
>> >> > If
>> >> > the
>> >> > group region needs morethan one page when the report is rendered
>> >> > then
>> >> > the
>> >> > next pages will not have the header or footer text.
>> >> >
>> >> > Case Image: No means at all!!!!!
>> >> >
>> >> > Is there any way of achieving this? Please help ...
>> >> > --
>> >> > Goit
>> >>
>> >>
>> >>
>>

Monday, March 12, 2012

I'm confused with the non-unicode

I was confused with the non-unicode when i insert chinese characters in
a varchar field using asp page, it accepted the characters and
displayed correctly. It is good for me, but i was wondering what
exactly non-unicode is and why acting like that way(I expected to
receive strange characters in the feedback asp page but i didn't). Can
anyone tell me the reason?What is the collation of the column in the table? Also, did you try
comparing two columns with that data?
MC
"jane" <bidepan@.msn.com> wrote in message
news:1167926378.282209.127980@.6g2000cwy.googlegroups.com...
>I was confused with the non-unicode when i insert chinese characters in
> a varchar field using asp page, it accepted the characters and
> displayed correctly. It is good for me, but i was wondering what
> exactly non-unicode is and why acting like that way(I expected to
> receive strange characters in the feedback asp page but i didn't). Can
> anyone tell me the reason?
>|||Thanks for your reply MC, it's all default setting. I can't understand
your other question. It appears to be like ऒझ stored in the
database but it is displayed correctly(the correct character)in asp
pages. what i'm conserning is why the Unicode data can be stored in a
varchar(for non-Unicode) column and retrieved correctly, which i
suppose should not.
On Jan 4, 1:03 pm, "MC" <marko.NOSPAMc...@.gmail.com> wrote:
> What is the collation of the column in the table? Also, did you try
> comparing two columns with that data?
> MC
> "jane" <bide...@.msn.com> wrote in messagenews:1167926378.282209.127980@.6g2000cwy.googlegroups.com...
>
> >I was confused with the non-unicode when i insert chinese characters in
> > a varchar field using asp page, it accepted the characters and
> > displayed correctly. It is good for me, but i was wondering what
> > exactly non-unicode is and why acting like that way(I expected to
> > receive strange characters in the feedback asp page but i didn't). Can
> > anyone tell me the reason... Hide quoted text -- Show quoted text -|||Well, basically you're reading the same characters you inserted. My second q
was, did you try comparing on those characters? For example:
Table1 has col1 varchar(100)
Table2 has col2 varchar(100)
Insert same string in both tables (chinese chars). Then see what happens
when you say WHERE col1 = col2 or something like that (thats what I meant by
comparing values). Try the same thing with parameter and comparing values
in columns to parameter...
MC
"jane" <bidepan@.msn.com> wrote in message
news:1167936168.510779.204100@.s80g2000cwa.googlegroups.com...
> Thanks for your reply MC, it's all default setting. I can't understand
> your other question. It appears to be like ऒझ stored in the
> database but it is displayed correctly(the correct character)in asp
> pages. what i'm conserning is why the Unicode data can be stored in a
> varchar(for non-Unicode) column and retrieved correctly, which i
> suppose should not.
> On Jan 4, 1:03 pm, "MC" <marko.NOSPAMc...@.gmail.com> wrote:
>> What is the collation of the column in the table? Also, did you try
>> comparing two columns with that data?
>> MC
>> "jane" <bide...@.msn.com> wrote in
>> messagenews:1167926378.282209.127980@.6g2000cwy.googlegroups.com...
>>
>> >I was confused with the non-unicode when i insert chinese characters in
>> > a varchar field using asp page, it accepted the characters and
>> > displayed correctly. It is good for me, but i was wondering what
>> > exactly non-unicode is and why acting like that way(I expected to
>> > receive strange characters in the feedback asp page but i didn't). Can
>> > anyone tell me the reason... Hide quoted text -- Show quoted text -
>