Showing posts with label http. Show all posts
Showing posts with label http. Show all posts

Wednesday, March 21, 2012

Quotes and ImageURL/External behavour

Hi All,
Can anyone explain this weirdness? If I have an Image set to External
with a URL of http://localhost/myimagepage.asp?MediaID=82 I can see the
image in the designer and also at run time. This is without an equals
sign at the front as well, so just the plain string starting with http.
But...
If I then add an equals sign to the start of the string and put quotes
around it so that it reads;
="http://localhost/myimagepage.asp?MediaID=82"
Then broken images abound (red crosses), in the report design and at
run time.
My thoughts are that;
a) I have a broken version of reporting services (I have checked the
version and I have RS SP2 installed).
b) The report server is taking the string data as the image data, not
the URL of the image data.
Am I missing something obvious, it seems as if everyone else has this
figured.
Thanks in advanceWell, I found this one, a small flaw in Reporting Services and a
problem with Internet Explorer/Firefox.
There were two problems;
1) IE sometimes uploads files as mime type image/pjpeg, RS does not
like these.
2) The response object writing the HTTP headers from ASP.net required
the following code;
Response.Charset = ""
To fix point 1, I just checked for pjpeg and jpg and returned jpeg
instead, all works well.
The problem with RS is that it will let you stare at these things for
ages and not give you any detail on why it won't render. Additional
feedback (possibly via error images) would be great in the next
version.
Ryansql

Wednesday, March 7, 2012

Quick Import Wizard Question - Importing XML Data

Hello,

I want to import some XML data from the internet. For example, http://www.somexmldata.com/ returns some well formatted XML data that I want to import into SQL Server 2005.

If I create an Integration Services Project it's easy - I use an 'XML Source' and specify the URL as the 'XML location'. Job done!

However, I want to do it using the Data Import Wizard - how do I accomplish the same thing?

Many thanks,
BenUnfortunately, we were not able to add support for XML sources to the Import Wizard.

That is something that should be part of our upcoming work.

You are welcome to request that at the product feedback site.

Monday, February 20, 2012

Questions on ReportExecution2005

I following the instruction on http://support.microsoft.com /?kbid=875447 and did the following:

(1) I added the Web Reference http://ReportServerName/ReportServer/ReportExecution2005.asmx and named it rsReportExecution2005.

(2) In the web page, I Imports rsReportExecution2005.

(3) In the button_click event I have the following code:

Dim rsReportExec As ReportExecutionService = New ReportExecutionService

rsReportExec.Credentials = System.Net.CredentialCache.DefaultCredentials

Dim byteResult As Byte = Nothing

Dim strReportPath As String = "ReportViewer.aspx?%2fCAIT%2frptIssuesByRole&rs:Command=Render&intProjectID=" & Me.cboProject.SelectedValue & "&nvchrWhoRan=" & Session("strEmployeeName")

Dim strFormat As String = "MSWord"

Dim strEncoding As String = ""

Dim strMineType As String = ""

Dim strExtension As String = ""

Dim wrnWarnings As Warning = Nothing

Dim strStreamIDs As String = Nothing

Dim execInfo As ExecutionInfo = New ExecutionInfo

Dim execHeader As ExecutionHeader = New ExecutionHeader

rsReportExec.ExecutionHeaderValue = execHeader

execInfo = rsReportExec.LoadReport(strReportPath, Me.cboProject.SelectedValue)

Dim strSessionID As String = rsReportExec.ExecutionHeaderValue.ExecutionID

byteResult = rsReportExec.Render(strFormat, Nothing, strExtension, strEncoding, strMineType, wrnWarnings, strStreamIDs)

I got errors on the last line above on wrnWarnings that "value of type 'rsReportExec.warning' cannot be converted to '1-dimensional array of 'rsReportExec.warning' " and on strStreamIDs that "value of type 'string' cannot be converted to '1-dimensional array of 'string'". What did I miss?

Thanks.

DanYeung

Change this:

Dim wrnWarnings As Warning = Nothing

Dim strStreamIDs As String = Nothing

to this:

Dim wrnWarnings As Warning() = Nothing

Dim strStreamIDs As String() = Nothing

You declare the variables as a single variable, but the Render function expects to see arrays in those locations

See this link:

http://msdn2.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsexecutionservice2005.reportexecutionservice.render.aspx

This give you following declaration:

Public Function Render ( _
Format As String, _
DeviceInfo As String, _
ByRef Extension As String, _
ByRef MimeType As String, _
ByRef Encoding As String, _
ByRef Warnings As Warning(), _
ByRef StreamIds As String() _
) As Byte()

|||

Thanks.

|||

The example in the link http://msdn2.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsexecutionservice2005.reportexecutionservice.render.aspx passes only one parameter (the historyID), execInfo = rs.LoadReport(reportPath, historyID);. How do I pass multiple parameters?

Thanks.

|||

Take a closer look at the code example. It actually sets 3 report parameters

It sets the parameters below

' Prepare report parameter.
Dim parameters(2) As ParameterValue

parameters(0) = New ParameterValue()
parameters(0).Name = "EmpID"
parameters(0).Value = "288"
parameters(1) = New ParameterValue()
parameters(1).Name = "ReportMonth"
parameters(1).Value = "6" ' June
parameters(2) = New ParameterValue()
parameters(2).Name = "ReportYear"
parameters(2).Value = "2004"

... [clipped]...


execInfo = rs.LoadReport(reportPath, historyID)

rs.SetExecutionParameters(parameters, "en-us")

"SetExecutionParameters" is fairly obviously the command that would set the report parameters, not the LoadReport method.

You must load the report first, then assign the parameters array you created to the report using the SetExecutionParameters method.

|||

Refering to execInfo = rs.LoadReport(reportPath, historyID), historyID has not been assigned value. Why is it being used and why is it required? Refering to rs.SetExecutionParameters(parameters, "en-us"), what is "en-us"?

Thanks.

DanYeung

|||

In addition of the above question, how can I get the reportPath programmatically so I don't have to hard code? Please refer to the link http://msdn2.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsexecutionservice2005.reportexecutionservice.render.aspx.

Thanks.

DanYeung