Showing posts with label report. Show all posts
Showing posts with label report. Show all posts

Thursday, March 22, 2012

on subreport

Hi
I have a main Report MR - i added a subreport to it SR1 - and it works fine
but when i try to add another subreport SR2 - it gives me an error
ERROR: subreport could not be shown. It only hapens with this particular rdl.
The subreport thing works for other rdls. the supreport SR2 works fine as
standalone.
Pls helpgot it - i was not passing the parameters
"RP" wrote:
> Hi
> I have a main Report MR - i added a subreport to it SR1 - and it works fine
> but when i try to add another subreport SR2 - it gives me an error
> ERROR: subreport could not be shown. It only hapens with this particular rdl.
> The subreport thing works for other rdls. the supreport SR2 works fine as
> standalone.
> Pls helpsql

Embed PDF inside of SQL Server Report Servics Report

Hi ...

I posted this same question on the ASP.NET forum and haven't received an answer, so I thought I'ld move the discussion over to this forum. My question has been read several times, so I know I'm not the only one facing this problem, but nobody seems to know how to make it happen.

Anyhow, I'm building a system where we collect a great deal of meta data inside of SQL Server. The meta data is associated wtih files that the users can attach - image files and PDFs. I can get the image files to display properly, however I can find no way to actually display the contents of the PDF file as part of the report.

We want to print out the meta data as a header to the PDF and then print the PDF in it's entirety. As an example, we would print out:

Emergency Plan Name: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Facility Name: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Last Review Date: 99/99/9999 Reviewed By: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

HERE IS WHERE I WOULD WANT TO PRINT OUT THE ASSOCIATED PDF's --

-- Emergency Plan --

-- Evacuation Plan 1 --

-- Evacuation Plan 2 --

I can print the file names - they are fields in the database, but how do I embed the actual PDF in to the report? They can print on different pages - I don't care about that, but I need to get them to be a part of the report.

Thanks ...

David

Any day above ground is a good day!

It's not possible to embed a PDF in a RS report.

If they're single page PDF's then you could try and code something clever that outputs them as images and embed the images.

Other than that I don't see a way of doing this.

|||Ok, so there is no built in functionality to handle embedding and outputting PDF's within reports built via SSRS. Has anyone seen any Custom Report Items that have been built that would allow me to have PDF's print in-line as part of the report?

Thanks ...

David
Any day above ground is a good day!|||

Beyond PDF embedding - where is a good site to review Custom Report Items? Either for purchase or open source?

Thanks ...

David

Any day above ground is a good day!

sql

Tuesday, March 20, 2012

:( Please Help Needed on Printing Report in RS

Hi All Experts,
I caught in a big problem, previosly our application was using Crystal
Report, but on my suggestion Project Manager changed the reporting tool
for next client and we are decided to use RS and removed CR from our
application.
There are 50 Reports, we designed it well and we dont find any
problems. But out of those reports, two reports are autoprint reports.
The scenario is, i want to print a report which accepts parameter
without user interaction (there might be any number of pages) at server
side (This is a Major Feature of our application). I used Printer
Deliver Sample, but it is time or data driven , but i want to do this
job through my code, means at certain line of code i have to print the
report. Also Delivery Extension uses static parameter, how do i change
it runtime? I also used RsClientprint but it shows printer dialog which
i dont want to show.
Please help me, all eyes in my team are looking towards me like i did a
wrong decision. I am very thankful to all if i receive the solution.
Thank You
Regards
Rajone thing i forgot, i want to print this report in Printed Stationary
with duplicate on same page, means i have to set right, left, top and
bottom margin, i used ReportRender Method, in which i converted report
into EMF and send the stream to printer but i am not able to set
margins, also i am not getting report print what i designed|||Raj,
The "Print a report from a console app" download from this site might
be of help to you. http://www.gotreportviewer.com/
Andy Pottersql

Monday, March 19, 2012

.rss methods no longer supported

I am having a problem running a sql2k report service script on my new sql2005 server. It seems that the methods SessionHeader() and rs.render are no longer suport. can someone help me figure out what I need to do to continue automating my report running?

rss file contents: (the parts that should matter)

--

Report Parameters
Dim branch as string = nothing

Dim skipreport as string = nothing
dim skip as integer = 0

dim allbranchreport as string = nothing
dim allbranch as integer = 0

dim report as CatalogItem
dim repname as string = nothing
dim specificreport as string = nothing
dim filepath as string = nothing
dim errorpath as string = nothing
dim basefilepath as string = nothing
dim baseerrorpath as string = nothing
dim errorlog as integer = 0
Dim parameters() As ParameterValue = nothing
Dim paramcount as integer = 0

' Render arguments
Dim result As Byte() = Nothing
Dim reportPath As String = nothing
'Dim format As String = "PDF"
Dim format as string = "EXCEL"
Dim historyID As String = Nothing
Dim devInfo as string = Nothing
Dim credentials As DataSourceCredentials() = Nothing
Dim showHideToggle As String = Nothing
Dim encoding As String
Dim mimeType As String
Dim warnings As Warning() = Nothing
Dim reportHistoryParameters As ParameterValue() = Nothing
Dim streamIDs As String() = Nothing
Dim sh As New SessionHeader()
rs.SessionHeaderValue = sh

Dim omitdocmap as string = "True"
'**************************************

'**************************************
'Repset run
Dim repset as string = ""
for each repset in repsetlist
specificreports = specificreportsstart
if specificreports = 0 then
select case repset.tolower
case "all"
specificreports = 0
case "brkctr"
specificreports = 1
reportcount = reportset_brkctr.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_brkctr(reportloop)
next
case "cashmgmt"
specificreports = 1
reportcount = reportset_cashmgmt.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_cashmgmt(reportloop)
next
case "com"
specificreports = 1
reportcount = reportset_com.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_com(reportloop)
next
case "com_vw"
specificreports = 1
reportcount = reportset_com_vw.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_com_vw(reportloop)
next
repset = "com"
case "comcons"
specificreports = 1
reportcount = reportset_comcons.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_comcons(reportloop)
next
case "cons"
specificreports = 1
reportcount = reportset_cons.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_cons(reportloop)
next
case "cons_vw"
specificreports = 1
reportcount = reportset_cons_vw.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_cons_vw(reportloop)
next
repset = "cons"
case "dep"
specificreports = 1
reportcount = reportset_dep.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_dep(reportloop)
next
case "staff"
specificreports = 1
reportcount = reportset_staff.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_staff(reportloop)
next
omitdocmapbranch = "False"
case "staff2"
specificreports = 1
reportcount = reportset_staff2.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_staff2(reportloop)
next
omitdocmapbranch = "False"
case else
specificreports = 1
redim specificreportslist(0)
specificreportslist(0) = "Undefined"
end select

if repset.tolower = "staff2" then repset = "staff"
End if


'Base values
basefilepath = basepath & client & "\" & repset & "\"
baseerrorpath = basepath & client & "\" & "error_" & repset & "_"


'Reports List
Dim reports() as CatalogItem
reports = rs.ListChildren(basereportpath, False)

'Execution
if datasourceok = 1 then
for each report in reports

skip = 0
allbranch = allbranchrun

for each skipreport in skipreports
if report.name.tolower = skipreport.tolower then skip = 1
next

if skip = 0 then
if specificreports = 1 then
skip = 1
for each specificreport in specificreportslist
if report.name.tolower = specificreport.tolower then skip = 0
next
end if
end if

if skip = 0 then
for each allbranchreport in allbranchreports
if report.name.tolower = allbranchreport.tolower then allbranch = 1
next

Redim parameters(1)
parameters(0) = New ParameterValue()
parameters(0).name = "branchall"
parameters(1) = New ParameterValue()
parameters(1).Name = "branch"

'5 parameters reports
repname = report.name
if (repname.substring(0,5).tolower = "loans" or repname.substring(0,4).tolower = "locs") then paramcount = 4
if (repname.length >= 13) then
if repname.substring(0,13).tolower = "loans_beacons" then paramcount = 1
end if

if paramcount = 4 then
paramcount = 0
redim preserve parameters(4)

parameters(2) = New ParameterValue()
parameters(2).name = "comconsall"
if repset.tolower = "cons" or repset.tolower = "com" then parameters(2).value = 0 else parameters(2).value = 1

parameters(3) = New ParameterValue()
parameters(3).Name = "comcons"
if repset.tolower = "com" then parameters(3).value = "commercial" else parameters(3).value = "consumer"

parameters(4) = New ParameterValue()
parameters(4).Name = "brokered"
parameters(4).value = 0
if repset.substring(0,3).tolower = "brk" then parameters(4).value = 1
end if

'All Branches Reports
if allbranch = 1 then

parameters(0).value = "1"
parameters(1).value = "admin"
if client = "CSCU" then parameters(1).value = "newwst"
if clienttype = "vw" then parameters(1).value = "1"

errorlog = 0
filepath = basefilepath & report.name & ".xls"
errorpath = baseerrorpath & report.name & ".txt"
reportpath = basereportpath & "/" & report.name
omitdocmap = omitdocmapall
devinfo = "<DeviceInfo><OmitDocumentMap>" & omitdocmap & "</OmitDocumentMap></DeviceInfo>"

Console.WriteLine (repset.toupper & " " & report.name & " All branches")

Try
result = rs.Render(reportPath, format, historyID, devInfo, parameters, _
credentials, showHideToggle, encoding, mimeType, reportHistoryParameters, warnings, streamIDs)
sh.SessionId = rs.SessionHeaderValue.SessionId
Catch e As SoapException
errorlog = 1
Console.WriteLine(e.Detail.OuterXml)
Catch f as Exception
errorlog = 1
Console.writeline(f.message)
End Try

' Create an error log
If errorlog <> 0 then
Try
Dim stream As FileStream = File.Create(errorpath, 1024)
Console.WriteLine("Errorlog created: " & errorpath)
stream.Close()
Catch g As Exception
Console.WriteLine(g.Message)
End Try
End if

' Write the contents of the report to a file.
If errorlog <> 1 then
Try
Dim stream As FileStream = File.Create(filepath, result.Length)
stream.Write(result, 0, result.Length)
Console.WriteLine("Result written to file: " & filepath)
stream.Close()

Catch e As Exception
Console.WriteLine(e.Message)
End Try
end if


'Other Reports
else
parameters(0).value = "0"

for each branch in branches
parameters(1).value = branch

errorlog = 0
if branch <> "h/o" then
filepath = basefilepath & branch & "\" & report.name & ".xls"
else
filepath = basefilepath & "ho\" & report.name & ".xls"
end if
if branch <> "h/o" then
errorpath = baseerrorpath & branch & "_" & report.name & ".txt"
else
errorpath = baseerrorpath & "ho_" & report.name & ".txt"
end if
reportpath = basereportpath & "/" & report.name
omitdocmap = omitdocmapbranch
devinfo = "<DeviceInfo><OmitDocumentMap>" & omitdocmap & "</OmitDocumentMap></DeviceInfo>"

Console.WriteLine (repset.toupper & " " & report.name & " " & "Branch: " & branch)

Try
result = rs.Render(reportPath, format, historyID, devInfo, parameters, _
credentials, showHideToggle, encoding, mimeType, reportHistoryParameters, warnings, streamIDs)
sh.SessionId = rs.SessionHeaderValue.SessionId
Catch e As SoapException
errorlog = 1
Console.WriteLine(e.Detail.OuterXml)
Catch f as Exception
errorlog = 1
Console.writeline(f.message)
End Try

' Create an error log
If errorlog <> 0 then
Try
Dim stream As FileStream = File.Create(errorpath, 1024)
Console.WriteLine("Errorlog created: " & errorpath)
stream.Close()
Catch g As Exception
Console.WriteLine(g.Message)
End Try
End if

' Write the contents of the report to a file.
If errorlog <> 1 then
Try
Dim stream As FileStream = File.Create(filepath, result.Length)
stream.Write(result, 0, result.Length)
Console.WriteLine("Result written to file: " & filepath)
stream.Close()

Catch e As Exception
Console.WriteLine(e.Message)
End Try
end if

next
end if

end if
next
end if
next

-

I get this error message from cmd when I try and run my batch:

-

J:\PRA Publisher>rs -i pra_publisher.rss -s http://localhost/reportserver -l 0

The specified script failed to compile with the following errors:
J:\PRA Publisher> "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\vbc.exe" /t:exe
/main:MainModule /utf8output /R:"System.dll" /R:"System.Xml.dll" /R:"System.Web
.Services.dll" /R:"C:\Program Files\Microsoft SQL Server\90\Tools\binn\rs.exe" /
out:"C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.exe" /debug-
"C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.0.vb" "C:\Docu
ments and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb"


Microsoft (R) Visual Basic Compiler version 8.0.50727.42
for Microsoft (R) .NET Framework version 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.

C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(253) : error
BC30002: Type 'SessionHeader' is not defined.

Dim sh As New SessionHeader()
~~~~~~~~~~~~~
C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(254) : error
BC30456: 'SessionHeaderValue' is not a member of 'Microsoft.SqlServer.Reporting
Services2005.ReportingService2005'.

rs.SessionHeaderValue = sh
~~~~~~~~~~~~~~~~~~~~~
C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(434) : error
BC30456: 'Render' is not a member of 'Microsoft.SqlServer.ReportingServices2005
.ReportingService2005'.

result = rs.Render(reportPath, format, historyID, de
vInfo, parameters, _
~~~~~~~~~

C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(436) : error
BC30456: 'SessionHeaderValue' is not a member of 'Microsoft.SqlServer.Reporting
Services2005.ReportingService2005'.

sh.SessionId = rs.SessionHeaderValue.SessionId
~~~~~~~~~~~~~~~~~~~~~
C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(496) : error
BC30456: 'Render' is not a member of 'Microsoft.SqlServer.ReportingServices2005
.ReportingService2005'.

result = rs.Render(reportPath, format, historyID
, devInfo, parameters, _
~~~~~~~~~

C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(498) : error
BC30456: 'SessionHeaderValue' is not a member of 'Microsoft.SqlServer.Reporting
Services2005.ReportingService2005'.

sh.SessionId = rs.SessionHeaderValue.SessionId
~~~~~~~~~~~~~~~~~~~~~

--

Any advice on how to fix this would be graetly appreciated. Thanks!

The version of rs.exe that ships with SQL 2005 is configured to run against the new 2005 management SOAP endpoint by default. The old 2000 endpoint is still supported. Just add -e mgmt2000 to the command line to use the old endpoint. You can get more information on this option by running rs.exe /? or in the MSDN help files.|||

Thank you so much!!!

That seems to be working beautifully. Just started the batch and its running smoothly so far!

|||

Hi,

my opinion is that this is not a solution, only a workaround. How would a script look like, which is using the ReportingServices2005 endpoint and methods.

I could use the endpoint by this

Dim rs As New ReportingService2005()

But now the debugger tells me that the render method is not a member of Microsoft.SqlServer.ReportingServices2005.ReportingServices2005 .

I want to render a report to the file system. This is the whole script:

' Export report to pdf format to the specified path under filePath and to the file which is specified under fileN
Dim format as string = "PDF"
Dim filePath as String = "D:\temp\"
Dim fileN as String = "reportx"
'Dim Datum as String = CString(Date)
Dim fileName as String = filePath + fileN + ".pdf"
Dim reportPath as String = "/reportx/reportx

Public Sub Main()

' Prepare Render arguments
Dim historyID as string = Nothing
Dim deviceInfo as string = Nothing
Dim showHide as string = Nothing
Dim results() as Byte
Dim encoding as string
Dim mimeType as string = "application/pdf"
Dim warnings() AS Warning = Nothing
Dim reportHistoryParameters() As ParameterValue = Nothing
Dim streamIDs() as string = Nothing
'Windows Credentials were send to Reporting server service
Dim rs As New ReportingService2005()
rs.Credentials = System.Net.CredentialCache.DefaultCredentials


' Report Parameters
Dim parameters(0) As ParameterValue
results = rs.Render(reportPath, format, _
Nothing, Nothing, Nothing, _
Nothing, Nothing, encoding, mimeType, _
reportHistoryParameters, warnings, streamIDs)

' Open a file stream and write out the report
Dim stream As FileStream = File.OpenWrite(fileName)
stream.Write(results, 0, results.Length)
stream.Close()

End Sub

'End of script

.rss methods no longer supported

I am having a problem running a sql2k report service script on my new sql2005 server. It seems that the methods SessionHeader() and rs.render are no longer suport. can someone help me figure out what I need to do to continue automating my report running?

rss file contents: (the parts that should matter)

--

Report Parameters
Dim branch as string = nothing

Dim skipreport as string = nothing
dim skip as integer = 0

dim allbranchreport as string = nothing
dim allbranch as integer = 0

dim report as CatalogItem
dim repname as string = nothing
dim specificreport as string = nothing
dim filepath as string = nothing
dim errorpath as string = nothing
dim basefilepath as string = nothing
dim baseerrorpath as string = nothing
dim errorlog as integer = 0
Dim parameters() As ParameterValue = nothing
Dim paramcount as integer = 0

' Render arguments
Dim result As Byte() = Nothing
Dim reportPath As String = nothing
'Dim format As String = "PDF"
Dim format as string = "EXCEL"
Dim historyID As String = Nothing
Dim devInfo as string = Nothing
Dim credentials As DataSourceCredentials() = Nothing
Dim showHideToggle As String = Nothing
Dim encoding As String
Dim mimeType As String
Dim warnings As Warning() = Nothing
Dim reportHistoryParameters As ParameterValue() = Nothing
Dim streamIDs As String() = Nothing
Dim sh As New SessionHeader()
rs.SessionHeaderValue = sh

Dim omitdocmap as string = "True"
'**************************************

'**************************************
'Repset run
Dim repset as string = ""
for each repset in repsetlist
specificreports = specificreportsstart
if specificreports = 0 then
select case repset.tolower
case "all"
specificreports = 0
case "brkctr"
specificreports = 1
reportcount = reportset_brkctr.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_brkctr(reportloop)
next
case "cashmgmt"
specificreports = 1
reportcount = reportset_cashmgmt.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_cashmgmt(reportloop)
next
case "com"
specificreports = 1
reportcount = reportset_com.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_com(reportloop)
next
case "com_vw"
specificreports = 1
reportcount = reportset_com_vw.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_com_vw(reportloop)
next
repset = "com"
case "comcons"
specificreports = 1
reportcount = reportset_comcons.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_comcons(reportloop)
next
case "cons"
specificreports = 1
reportcount = reportset_cons.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_cons(reportloop)
next
case "cons_vw"
specificreports = 1
reportcount = reportset_cons_vw.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_cons_vw(reportloop)
next
repset = "cons"
case "dep"
specificreports = 1
reportcount = reportset_dep.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_dep(reportloop)
next
case "staff"
specificreports = 1
reportcount = reportset_staff.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_staff(reportloop)
next
omitdocmapbranch = "False"
case "staff2"
specificreports = 1
reportcount = reportset_staff2.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_staff2(reportloop)
next
omitdocmapbranch = "False"
case else
specificreports = 1
redim specificreportslist(0)
specificreportslist(0) = "Undefined"
end select

if repset.tolower = "staff2" then repset = "staff"
End if


'Base values
basefilepath = basepath & client & "\" & repset & "\"
baseerrorpath = basepath & client & "\" & "error_" & repset & "_"


'Reports List
Dim reports() as CatalogItem
reports = rs.ListChildren(basereportpath, False)

'Execution
if datasourceok = 1 then
for each report in reports

skip = 0
allbranch = allbranchrun

for each skipreport in skipreports
if report.name.tolower = skipreport.tolower then skip = 1
next

if skip = 0 then
if specificreports = 1 then
skip = 1
for each specificreport in specificreportslist
if report.name.tolower = specificreport.tolower then skip = 0
next
end if
end if

if skip = 0 then
for each allbranchreport in allbranchreports
if report.name.tolower = allbranchreport.tolower then allbranch = 1
next

Redim parameters(1)
parameters(0) = New ParameterValue()
parameters(0).name = "branchall"
parameters(1) = New ParameterValue()
parameters(1).Name = "branch"

'5 parameters reports
repname = report.name
if (repname.substring(0,5).tolower = "loans" or repname.substring(0,4).tolower = "locs") then paramcount = 4
if (repname.length >= 13) then
if repname.substring(0,13).tolower = "loans_beacons" then paramcount = 1
end if

if paramcount = 4 then
paramcount = 0
redim preserve parameters(4)

parameters(2) = New ParameterValue()
parameters(2).name = "comconsall"
if repset.tolower = "cons" or repset.tolower = "com" then parameters(2).value = 0 else parameters(2).value = 1

parameters(3) = New ParameterValue()
parameters(3).Name = "comcons"
if repset.tolower = "com" then parameters(3).value = "commercial" else parameters(3).value = "consumer"

parameters(4) = New ParameterValue()
parameters(4).Name = "brokered"
parameters(4).value = 0
if repset.substring(0,3).tolower = "brk" then parameters(4).value = 1
end if

'All Branches Reports
if allbranch = 1 then

parameters(0).value = "1"
parameters(1).value = "admin"
if client = "CSCU" then parameters(1).value = "newwst"
if clienttype = "vw" then parameters(1).value = "1"

errorlog = 0
filepath = basefilepath & report.name & ".xls"
errorpath = baseerrorpath & report.name & ".txt"
reportpath = basereportpath & "/" & report.name
omitdocmap = omitdocmapall
devinfo = "<DeviceInfo><OmitDocumentMap>" & omitdocmap & "</OmitDocumentMap></DeviceInfo>"

Console.WriteLine (repset.toupper & " " & report.name & " All branches")

Try
result = rs.Render(reportPath, format, historyID, devInfo, parameters, _
credentials, showHideToggle, encoding, mimeType, reportHistoryParameters, warnings, streamIDs)
sh.SessionId = rs.SessionHeaderValue.SessionId
Catch e As SoapException
errorlog = 1
Console.WriteLine(e.Detail.OuterXml)
Catch f as Exception
errorlog = 1
Console.writeline(f.message)
End Try

' Create an error log
If errorlog <> 0 then
Try
Dim stream As FileStream = File.Create(errorpath, 1024)
Console.WriteLine("Errorlog created: " & errorpath)
stream.Close()
Catch g As Exception
Console.WriteLine(g.Message)
End Try
End if

' Write the contents of the report to a file.
If errorlog <> 1 then
Try
Dim stream As FileStream = File.Create(filepath, result.Length)
stream.Write(result, 0, result.Length)
Console.WriteLine("Result written to file: " & filepath)
stream.Close()

Catch e As Exception
Console.WriteLine(e.Message)
End Try
end if


'Other Reports
else
parameters(0).value = "0"

for each branch in branches
parameters(1).value = branch

errorlog = 0
if branch <> "h/o" then
filepath = basefilepath & branch & "\" & report.name & ".xls"
else
filepath = basefilepath & "ho\" & report.name & ".xls"
end if
if branch <> "h/o" then
errorpath = baseerrorpath & branch & "_" & report.name & ".txt"
else
errorpath = baseerrorpath & "ho_" & report.name & ".txt"
end if
reportpath = basereportpath & "/" & report.name
omitdocmap = omitdocmapbranch
devinfo = "<DeviceInfo><OmitDocumentMap>" & omitdocmap & "</OmitDocumentMap></DeviceInfo>"

Console.WriteLine (repset.toupper & " " & report.name & " " & "Branch: " & branch)

Try
result = rs.Render(reportPath, format, historyID, devInfo, parameters, _
credentials, showHideToggle, encoding, mimeType, reportHistoryParameters, warnings, streamIDs)
sh.SessionId = rs.SessionHeaderValue.SessionId
Catch e As SoapException
errorlog = 1
Console.WriteLine(e.Detail.OuterXml)
Catch f as Exception
errorlog = 1
Console.writeline(f.message)
End Try

' Create an error log
If errorlog <> 0 then
Try
Dim stream As FileStream = File.Create(errorpath, 1024)
Console.WriteLine("Errorlog created: " & errorpath)
stream.Close()
Catch g As Exception
Console.WriteLine(g.Message)
End Try
End if

' Write the contents of the report to a file.
If errorlog <> 1 then
Try
Dim stream As FileStream = File.Create(filepath, result.Length)
stream.Write(result, 0, result.Length)
Console.WriteLine("Result written to file: " & filepath)
stream.Close()

Catch e As Exception
Console.WriteLine(e.Message)
End Try
end if

next
end if

end if
next
end if
next

-

I get this error message from cmd when I try and run my batch:

-

J:\PRA Publisher>rs -i pra_publisher.rss -s http://localhost/reportserver -l 0

The specified script failed to compile with the following errors:
J:\PRA Publisher> "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\vbc.exe" /t:exe
/main:MainModule /utf8output /R:"System.dll" /R:"System.Xml.dll" /R:"System.Web
.Services.dll" /R:"C:\Program Files\Microsoft SQL Server\90\Tools\binn\rs.exe" /
out:"C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.exe" /debug-
"C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.0.vb" "C:\Docu
ments and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb"


Microsoft (R) Visual Basic Compiler version 8.0.50727.42
for Microsoft (R) .NET Framework version 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.

C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(253) : error
BC30002: Type 'SessionHeader' is not defined.

Dim sh As New SessionHeader()
~~~~~~~~~~~~~
C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(254) : error
BC30456: 'SessionHeaderValue' is not a member of 'Microsoft.SqlServer.Reporting
Services2005.ReportingService2005'.

rs.SessionHeaderValue = sh
~~~~~~~~~~~~~~~~~~~~~
C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(434) : error
BC30456: 'Render' is not a member of 'Microsoft.SqlServer.ReportingServices2005
.ReportingService2005'.

result = rs.Render(reportPath, format, historyID, de
vInfo, parameters, _
~~~~~~~~~

C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(436) : error
BC30456: 'SessionHeaderValue' is not a member of 'Microsoft.SqlServer.Reporting
Services2005.ReportingService2005'.

sh.SessionId = rs.SessionHeaderValue.SessionId
~~~~~~~~~~~~~~~~~~~~~
C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(496) : error
BC30456: 'Render' is not a member of 'Microsoft.SqlServer.ReportingServices2005
.ReportingService2005'.

result = rs.Render(reportPath, format, historyID
, devInfo, parameters, _
~~~~~~~~~

C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(498) : error
BC30456: 'SessionHeaderValue' is not a member of 'Microsoft.SqlServer.Reporting
Services2005.ReportingService2005'.

sh.SessionId = rs.SessionHeaderValue.SessionId
~~~~~~~~~~~~~~~~~~~~~

--

Any advice on how to fix this would be graetly appreciated. Thanks!

The version of rs.exe that ships with SQL 2005 is configured to run against the new 2005 management SOAP endpoint by default. The old 2000 endpoint is still supported. Just add -e mgmt2000 to the command line to use the old endpoint. You can get more information on this option by running rs.exe /? or in the MSDN help files.|||

Thank you so much!!!

That seems to be working beautifully. Just started the batch and its running smoothly so far!

|||

Hi,

my opinion is that this is not a solution, only a workaround. How would a script look like, which is using the ReportingServices2005 endpoint and methods.

I could use the endpoint by this

Dim rs As New ReportingService2005()

But now the debugger tells me that the render method is not a member of Microsoft.SqlServer.ReportingServices2005.ReportingServices2005 .

I want to render a report to the file system. This is the whole script:

' Export report to pdf format to the specified path under filePath and to the file which is specified under fileN
Dim format as string = "PDF"
Dim filePath as String = "D:\temp\"
Dim fileN as String = "reportx"
'Dim Datum as String = CString(Date)
Dim fileName as String = filePath + fileN + ".pdf"
Dim reportPath as String = "/reportx/reportx

Public Sub Main()

' Prepare Render arguments
Dim historyID as string = Nothing
Dim deviceInfo as string = Nothing
Dim showHide as string = Nothing
Dim results() as Byte
Dim encoding as string
Dim mimeType as string = "application/pdf"
Dim warnings() AS Warning = Nothing
Dim reportHistoryParameters() As ParameterValue = Nothing
Dim streamIDs() as string = Nothing
'Windows Credentials were send to Reporting server service
Dim rs As New ReportingService2005()
rs.Credentials = System.Net.CredentialCache.DefaultCredentials


' Report Parameters
Dim parameters(0) As ParameterValue
results = rs.Render(reportPath, format, _
Nothing, Nothing, Nothing, _
Nothing, Nothing, encoding, mimeType, _
reportHistoryParameters, warnings, streamIDs)

' Open a file stream and write out the report
Dim stream As FileStream = File.OpenWrite(fileName)
stream.Write(results, 0, results.Length)
stream.Close()

End Sub

'End of script

|||

This link helped me: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=69650

I also saw that render error. Since I'm using rs.exe, I used the -e parameter to specify the endpoint. Here's the command line I used: rs -i sample2.rss -s http://localhost/reportserver -e Exec2005

And here's the contents of sample2.rss (very similar to yours):

'Dim format as string = "Excel"
'Dim fileName as String = "C:\Export2.xls"
Dim format as string = "PDF"
Dim fileName as String = "C:\Export2.pdf"
Dim reportPath as String = "/My_Reports/Test_Report"

Public Sub Main()

' Prepare Render arguments
Dim historyID as string = Nothing
Dim deviceInfo as string = Nothing
Dim showHide as string = Nothing
Dim results() as Byte
Dim encoding as string = Nothing
'Dim mimeType as string = "ms-excel"
'Dim extension as string = "xls"
Dim mimeType as string = "application/pdf"
Dim extension as string = "pdf"
Dim warnings() AS Warning = Nothing
Dim reportHistoryParameters() As ParameterValue = Nothing
Dim streamIDs() as string = Nothing

rs.Credentials = System.Net.CredentialCache.DefaultCredentials

Dim parameters(1) As ParameterValue
parameters(0) = New ParameterValue()
parameters(0).Name = "UserID"
parameters(0).Value = "myuserid"
parameters(1) = New ParameterValue()
parameters(1).Name = "GroupNum"
parameters(1).Value = Nothing
Dim execHeader AS New ExecutionHeader()
Dim rpt AS New ExecutionInfo
rpt = rs.LoadReport(reportPath, Nothing)
rs.SetExecutionParameters(parameters, "en-us")
rs.ExecutionHeaderValue = execHeader
rs.ExecutionHeaderValue.ExecutionID = rpt.ExecutionID
results = rs.Render(format, deviceInfo, extension, mimeType, encoding, warnings, streamIDs)

' Open a file stream and write out the report
Dim stream As FileStream = File.OpenWrite(fileName)
stream.Write(results, 0, results.Length)
stream.Close()

End Sub

Sunday, March 11, 2012

.rdlc reports - add values through textbox name?

hi all

have a .rdlc report like an invoice.

how can i add the values in my textboxes by the Name property of the Text Box.

like txtSubTotal.Text + txtTax.Text + txtShipping.Text. ?

all those fields are populated with calculations that run on the dataset and all have values. I just cant seem to write the proper syntax to add by control names, rather than field names.

well youshould use this syntax

ReportItems!txtSubTotal.Value + ReportItems!txtTax.Value + ReportItems!txtShipping.Value

NB: this wouldn't work whih agregiate functions unless used in a header or footer

Hope this help

|||

Yes I couldn't for the LIFE OF ME find any information on the

ReportItems! < identifier. AFter much searching i found it buried in a MSDN doc somewhere called "The 5 Elements of a Microsoft Report"

Anyways got it working fine now.

thanks,

mcm

|||

hi

Please tell me how to add Runtime value into Report.rdlc. I have two date(for start & end date) Controls on web page. I want to display those date on Report.rdlc using c#.

thanking you in advance

|||

here is a code fragment that could help you :

List<ReportParameter> par=new List<ReportParameter>();ReportParameter p=newReportParameter("saleid","43660");par.Add(p);this.reportViewer1.ServerReport.SetParameters(par);this.reportViewer1.RefreshReport();
Hope this helps

.RDLC report & getting pdf export in landscape

Hello,

.RDLC reports are driving me nuts... I've a report of which i've set dimensions to 29,7 cm width and 21 cm height. When I view the report in a reportviewer, everything looks cool and ok. When I export the report to PDF I get 2 A4 pages in portrait. How can I make the reportviewer export to PDF in LANDSCAPE?

Dieter

Ensure that you set the dimension onreport properties, notbody properties.

Regards,
Jess

|||

Go to the Report Properties and set the page width: 11in and Page height: 8.5 in

And your Body Width should be Page Width – (Left Margin + Right Margin). Make sure no control

On the Header Footer extends this width.

If you click Print and see if the orientation set to the "Landscape" if it is then it will be exported to PDF

in Landscape.

|||Thx Jess, that was the correct tip for me ... Silly mistake, silly me :)

.pdf rendering incorrectly

I have a report that is deployed at multiple sites without any problems, except one. At one site, when I render it to pdf, it doesn't look at all right, and the alignment on a table goes from center to right aligned for no obvious reason. It then stretches a textbox horizontally to force it onto another page. I've doublechecked and made sure that all the expand options on every single thing on the report is off, and I really don't understand why it would happen at only one site, even though the data is almost the exact same. Not only that, table cells don't stretch horizontally, they stretch vertically, so again, I'm stumped about why this one site would render incorrectly to a .pdf. Even in the report viewer, everything looks fine.

I am wondering if anyone has had a problem with rendering to pdf incorrectly when the rdl and data are correct, and what your solution was.

P.S. IT isn't a problem with margining, so please, don't give the generic "CHECK YOUR MARGINS" response.

Have you checked your margins?|||

Yes, I have... if it was a margining issue, it would be seen elsewhere I imagine. It's only at one site out of 10. The problem is there regardless of whether or not I leave the data fields in there or remove them. I've tried splitting the table in to two separate tables, no luck I can't duplicate the problem anywhere else.

This is the table in question... basic, nothing fancy.... adding up the column widths gives 7.75 in, its an 8.5x11 in with .25" margins... plenty of room to work with.

<Table Name="table1">
<Height>1.6in</Height>
<Style />
<KeepTogether>true</KeepTogether>
<Top>1.25in</Top>
<Width>7.75in</Width>
<TableGroups>
<TableGroup>
<Header>
<TableRows>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ColSpan>3</ColSpan>
<ReportItems>
<Textbox Name="textbox175">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<FontFamily>Verdana</FontFamily>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<FontSize>8pt</FontSize>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>36</ZIndex>
<Value>=FIRST(Fields!SortName.Value)</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox242">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<FontFamily>Verdana</FontFamily>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>8pt</FontSize>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>35</ZIndex>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ColSpan>3</ColSpan>
<ReportItems>
<Textbox Name="textbox243">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<Format>d</Format>
<FontFamily>Verdana</FontFamily>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<FontSize>8pt</FontSize>
<VerticalAlign>Bottom</VerticalAlign>
<TextAlign>Left</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>34</ZIndex>
<Value>=FIRST(Fields!BirthDate.Value)</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox244">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<FontFamily>Verdana</FontFamily>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>8pt</FontSize>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>33</ZIndex>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox245">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<FontFamily>Verdana</FontFamily>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<FontSize>8pt</FontSize>
<VerticalAlign>Bottom</VerticalAlign>
<TextAlign>Center</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>32</ZIndex>
<Value>=First(Fields!Gender_Code.Value)</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
<TableRow>
<Height>0.2in</Height>
<TableCells>
<TableCell>
<ColSpan>3</ColSpan>
<ReportItems>
<Textbox Name="textbox246">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>7pt</FontSize>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>31</ZIndex>
<Value>Student Name</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox250">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>7pt</FontSize>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>30</ZIndex>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ColSpan>3</ColSpan>
<ReportItems>
<Textbox Name="textbox251">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>7pt</FontSize>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>29</ZIndex>
<Value>Date of Birth (MM/dd/yyyy)</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox260">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>7pt</FontSize>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>28</ZIndex>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox269">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>7pt</FontSize>
<TextAlign>Center</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>27</ZIndex>
<Value>Sex</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ColSpan>3</ColSpan>
<ReportItems>
<Textbox Name="textbox270">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<FontFamily>Verdana</FontFamily>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<FontSize>8pt</FontSize>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>26</ZIndex>
<Value>=First(Fields!SSN.Value)</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox273">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<FontFamily>Verdana</FontFamily>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>8pt</FontSize>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>25</ZIndex>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ColSpan>5</ColSpan>
<ReportItems>
<Textbox Name="textbox274">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<FontFamily>Verdana</FontFamily>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<FontSize>8pt</FontSize>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>24</ZIndex>
<Value>=FIRST(Fields!PlaceOfBirth.Value)</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
<TableRow>
<Height>0.2in</Height>
<TableCells>
<TableCell>
<ColSpan>3</ColSpan>
<ReportItems>
<Textbox Name="textbox275">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>7pt</FontSize>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>23</ZIndex>
<Value>Social Security Number</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox278">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>7pt</FontSize>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>22</ZIndex>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ColSpan>5</ColSpan>
<ReportItems>
<Textbox Name="textbox279">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>7pt</FontSize>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>21</ZIndex>
<Value>Birth Place</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox284">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<FontFamily>Verdana</FontFamily>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<FontSize>8pt</FontSize>
<VerticalAlign>Bottom</VerticalAlign>
<TextAlign>Left</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>20</ZIndex>
<Value>=Fields!PhoneNumber.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox285">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<FontFamily>Verdana</FontFamily>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>8pt</FontSize>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>19</ZIndex>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox286">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<FontFamily>Verdana</FontFamily>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<FontSize>8pt</FontSize>
<VerticalAlign>Bottom</VerticalAlign>
<TextAlign>Left</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>18</ZIndex>
<Value>=Fields!LanguageType_CodeName.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox287">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<FontFamily>Verdana</FontFamily>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>8pt</FontSize>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>17</ZIndex>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox288">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<FontFamily>Verdana</FontFamily>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<FontSize>8pt</FontSize>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>16</ZIndex>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox289">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<FontFamily>Verdana</FontFamily>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>8pt</FontSize>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>15</ZIndex>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ColSpan>3</ColSpan>
<ReportItems>
<Textbox Name="textbox290">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<FontFamily>Verdana</FontFamily>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<FontSize>8pt</FontSize>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>14</ZIndex>
<Value>=Fields!Ethnicity_Code.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
<TableRow>
<Height>0.2in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox291">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>7pt</FontSize>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>13</ZIndex>
<Value>Home Phone</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox292">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>7pt</FontSize>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>12</ZIndex>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox293">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>7pt</FontSize>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>11</ZIndex>
<Value>Home Language</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox294">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>7pt</FontSize>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>10</ZIndex>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox295">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>7pt</FontSize>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>9</ZIndex>
<Value>Other Language</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox296">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>7pt</FontSize>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>8</ZIndex>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ColSpan>3</ColSpan>
<ReportItems>
<Textbox Name="textbox297">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>7pt</FontSize>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>7</ZIndex>
<Value>Ethnic Group</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox298">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>7pt</FontSize>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>6</ZIndex>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox299">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>7pt</FontSize>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>5</ZIndex>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox300">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>7pt</FontSize>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>4</ZIndex>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox301">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>7pt</FontSize>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>3</ZIndex>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox302">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>7pt</FontSize>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>2</ZIndex>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox303">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>7pt</FontSize>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>1</ZIndex>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ColSpan>3</ColSpan>
<ReportItems>
<Textbox Name="textbox304">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
<FontSize>7pt</FontSize>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<Value>(African American / Asian / Caucasian / Hispanic / Native American / Other)</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
</Header>
<Grouping Name="StudentId">
<GroupExpressions>
<GroupExpression>=Fields!LocalId.Value</GroupExpression>
</GroupExpressions>
</Grouping>
</TableGroup>
<TableGroup>
<Grouping Name="table1_Group2">
<GroupExpressions>
<GroupExpression>=Fields!FamilyRefId.Value</GroupExpression>
</GroupExpressions>
</Grouping>
</TableGroup>
</TableGroups>
<Left>0.125in</Left>
<TableColumns>
<TableColumn>
<Width>1.875in</Width>
</TableColumn>
<TableColumn>
<Width>0.125in</Width>
</TableColumn>
<TableColumn>
<Width>1.75in</Width>
</TableColumn>
<TableColumn>
<Width>0.25in</Width>
</TableColumn>
<TableColumn>
<Width>1.375in</Width>
</TableColumn>
<TableColumn>
<Width>0.125in</Width>
</TableColumn>
<TableColumn>
<Width>1.25in</Width>
</TableColumn>
<TableColumn>
<Width>0.125in</Width>
</TableColumn>
<TableColumn>
<Width>0.875in</Width>
</TableColumn>
</TableColumns>
</Table>

|||

Maybe you have to check some config values. Go to the following folder on that server which is rendering incorrectly:

Program Files\Microsoft SQL Server\MSSQL.X\Reporting Services\ReportServer and open the rsreportserver.config in a notepad.

Navigate to <Render> tag and then to <Extention name="PDF"> tag under that. Check if the Type="Microsoft.ReportingServices.Rendering.ImageRenderer.PdfReport,Microsoft.ReportingServices.ImageRendering"

If it's something else, probably that is the source of the problem.

Shyam

.Net Reportviewer

plese help me anybody working in .Net report viewer control
how to viewe the report in both Win forms and Webforms
sql server 2005 reporting server
EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.comWhat is your question? The best way to approach this is to first learn how
to create reports. Create and deploy the reports to the server. Make sure
you throughly understand creating reports including the use of sub reports
and drill through reports.
VS 2005 comes with two new controls (a winform and webform control). These
are the easiest way to view a report. The other option is either URL
integration (search on Books Online). The final option is to program web
services yourself. With the new controls I strongly recommend against doing
the last option.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
<mohan> wrote in message news:2006121355941ragu1100@.yahoo.com...
> plese help me anybody working in .Net report viewer control
> how to viewe the report in both Win forms and Webforms
> sql server 2005 reporting server
> EggHeadCafe.com - .NET Developer Portal of Choice
> http://www.eggheadcafe.com

.NET regular expression to replace #$# special ASCII characters

Help pleaseâ?¦ - I have a report with textbox field called â'Bulletsâ' â' using
#$# special ASCII characters (pound-dollar-pound) as bullet delimiter from
legacy print publishing system.
Questions:
1. What is the correct .NET regular expression to replace #$# special ASCII
characters within textbox field to display Bullet textâ?¦?
2. Can textbox field display Bullet textâ?¦?
Please advise MSDN or Books Online references for .NET regular expression
Replace syntax.
Thank you.
MichaelHere is an example
Input Text: tester#$#bullet_1#$#bullet_2#$#bullet_3#$#bullet_4
Regular Expression: (ASCII char Octal) \043\044\043
Replace Expression: (ASCII char Octal) \015\011\052\040\040\040
Question: Is there a Code Customization example for parsing a textbox field
and replacing regular expression characters with HTML Bullets - like
<BR><FONT family=Wingding>something_bullet_symbol</FONT><TAB>
Please advise.
"Michael" wrote:
> Help pleaseâ?¦ - I have a report with textbox field called â'Bulletsâ' â' using
> #$# special ASCII characters (pound-dollar-pound) as bullet delimiter from
> legacy print publishing system.
> Questions:
> 1. What is the correct .NET regular expression to replace #$# special ASCII
> characters within textbox field to display Bullet textâ?¦?
> 2. Can textbox field display Bullet textâ?¦?
> Please advise MSDN or Books Online references for .NET regular expression
> Replace syntax.
> Thank you.
> Michael
>|||I tried this expression
=IIF(Fields!product_Bullets.Value=#$#, Fields!product_Bullets.Value=*)
Got the following error
The value expression for the textbox â'Product_Bulletsâ' contains an error:
[BC30201] Expression expected.
Please advise the correct expression syntax.
"Michael" wrote:
> Here is an example
> Input Text: tester#$#bullet_1#$#bullet_2#$#bullet_3#$#bullet_4
> Regular Expression: (ASCII char Octal) \043\044\043
> Replace Expression: (ASCII char Octal) \015\011\052\040\040\040
> Question: Is there a Code Customization example for parsing a textbox field
> and replacing regular expression characters with HTML Bullets - like
> <BR><FONT family=Wingding>something_bullet_symbol</FONT><TAB>
> Please advise.
> "Michael" wrote:
> > Help pleaseâ?¦ - I have a report with textbox field called â'Bulletsâ' â' using
> > #$# special ASCII characters (pound-dollar-pound) as bullet delimiter from
> > legacy print publishing system.
> >
> > Questions:
> >
> > 1. What is the correct .NET regular expression to replace #$# special ASCII
> > characters within textbox field to display Bullet textâ?¦?
> > 2. Can textbox field display Bullet textâ?¦?
> >
> > Please advise MSDN or Books Online references for .NET regular expression
> > Replace syntax.
> >
> > Thank you.
> > Michael
> >|||I tried this expression - OK
=IIF(Fields!product_Bullets.Value="chr(35) + chr(36) + chr(35)", "",chr(13)
+ chr(42) + chr(9))
"Michael" wrote:
> I tried this expression
> =IIF(Fields!product_Bullets.Value=#$#, Fields!product_Bullets.Value=*)
> Got the following error
> The value expression for the textbox â'Product_Bulletsâ' contains an error:
> [BC30201] Expression expected.
> Please advise the correct expression syntax.
>
> "Michael" wrote:
> > Here is an example
> >
> > Input Text: tester#$#bullet_1#$#bullet_2#$#bullet_3#$#bullet_4
> >
> > Regular Expression: (ASCII char Octal) \043\044\043
> >
> > Replace Expression: (ASCII char Octal) \015\011\052\040\040\040
> >
> > Question: Is there a Code Customization example for parsing a textbox field
> > and replacing regular expression characters with HTML Bullets - like
> > <BR><FONT family=Wingding>something_bullet_symbol</FONT><TAB>
> >
> > Please advise.
> >
> > "Michael" wrote:
> >
> > > Help pleaseâ?¦ - I have a report with textbox field called â'Bulletsâ' â' using
> > > #$# special ASCII characters (pound-dollar-pound) as bullet delimiter from
> > > legacy print publishing system.
> > >
> > > Questions:
> > >
> > > 1. What is the correct .NET regular expression to replace #$# special ASCII
> > > characters within textbox field to display Bullet textâ?¦?
> > > 2. Can textbox field display Bullet textâ?¦?
> > >
> > > Please advise MSDN or Books Online references for .NET regular expression
> > > Replace syntax.
> > >
> > > Thank you.
> > > Michael
> > >|||Please help with regular expression syntax.
I have tried both these two expressions, using ascii hex - but I am still
getting lost on the on whether or not Reporting Services will support the
Replace function including a ascii hex Carriage Return or an ascii hex
Horizontal Tab replace string...?
=Replace(Fields!product_Bullets.Value, "[chr(35) + chr(36) + chr(35)]",
"chr(13) + chr(42) + chr(9)", "1", "-1", "1")
=Replace(Fields!product_Bullets.Value, "([\x23][\x24][\x23])",
"([\xD][\x2A][\x9])", "1", "-1", "1")
Please advise any suggestions for correct regular expression syntax.
"Michael" wrote:
> I tried this expression - OK
> =IIF(Fields!product_Bullets.Value="chr(35) + chr(36) + chr(35)", "",chr(13)
> + chr(42) + chr(9))
> "Michael" wrote:
> > I tried this expression
> >
> > =IIF(Fields!product_Bullets.Value=#$#, Fields!product_Bullets.Value=*)
> >
> > Got the following error
> >
> > The value expression for the textbox â'Product_Bulletsâ' contains an error:
> > [BC30201] Expression expected.
> >
> > Please advise the correct expression syntax.
> >
> >
> > "Michael" wrote:
> >
> > > Here is an example
> > >
> > > Input Text: tester#$#bullet_1#$#bullet_2#$#bullet_3#$#bullet_4
> > >
> > > Regular Expression: (ASCII char Octal) \043\044\043
> > >
> > > Replace Expression: (ASCII char Octal) \015\011\052\040\040\040
> > >
> > > Question: Is there a Code Customization example for parsing a textbox field
> > > and replacing regular expression characters with HTML Bullets - like
> > > <BR><FONT family=Wingding>something_bullet_symbol</FONT><TAB>
> > >
> > > Please advise.
> > >
> > > "Michael" wrote:
> > >
> > > > Help pleaseâ?¦ - I have a report with textbox field called â'Bulletsâ' â' using
> > > > #$# special ASCII characters (pound-dollar-pound) as bullet delimiter from
> > > > legacy print publishing system.
> > > >
> > > > Questions:
> > > >
> > > > 1. What is the correct .NET regular expression to replace #$# special ASCII
> > > > characters within textbox field to display Bullet textâ?¦?
> > > > 2. Can textbox field display Bullet textâ?¦?
> > > >
> > > > Please advise MSDN or Books Online references for .NET regular expression
> > > > Replace syntax.
> > > >
> > > > Thank you.
> > > > Michael
> > > >

Thursday, March 8, 2012

.Net Framework Issue in the MSSQL 2000?

I have a problem regarding the framework that the MSSQL2000 have. Is the MSSQL2000 report services only support for the .NET framework 1.0? or it can support >NET framework 2.0? any help will be appreciated.Thanx God Bless

As mentioned in your other thread - Reporting Services 2000 only works with .NET/ASP.NET 1.1.

-- Robert

Tuesday, March 6, 2012

.Net 2003 access Crystal Report XI: Error:Failed to open the connection: [Database Vendor Code:

I am receving this error: Failed to open the connection: [Database Vendor Code: 17 ], from .Net 2003/C# to Crystal Report XI with SQL Server 2000 has backend database.

Is there a security permission that has been overlooked?

Here is the code I use to access CR XI

ConnectionInfo connectionInfo = new ConnectionInfo();
TableLogOnInfo tableLogOnInfo;
Database DB;
'CrystalDecisions.CrystalReports.Engine.Table' table;
Tables tables;

//Log in
connectionInfo.ServerName = "ServerName";
connectionInfo.DatabaseName = "Database Namet";
connectionInfo.UserID = "userid";
connectionInfo.Password = "password";

//Get Table inf from report
DB = reportDocument..Database;
tables = DB.Tables;


//Looping through all the tables in CR and apply connection info
for(int i = 0; i < tables.Count; i++)
{
table = tables[ i ];
tableLogOnInfo = table.LogOnInfo;
tableLogOnInfo.ConnectionInfo = connectionInfo;
table.ApplyLogOnInfo(tableLogOnInfo);

}

CrystalReportViewer.ReportSource = ReportDocument.ReportSource;
CrystalReportViewer.Visible = true;

Any advise would be helpful.
Thank you

Hi, Koolaidbomber

First, try to find osql.exe on your client box, "c:\program files\microsoft sql server\80\tools\binn", osql.exe /S<servermachine> /E, or "osql.exe /S<servermachine>\<Instancename> /E"( the latter is for named instance). would you also get the same error? For remote connection specific you need following checklist:

A. Enable "File and printer sharing" in Firewall if your server is behind that.

B. Add program "sqlbrowser.exe" or udp port "1434" in your firewall exception list.

C. Add tcp port "1433" of default instance or <port number> of named instance in firewall, check you errorlog to figure out which port server is listening on. If you want your connection over TCP and make sure your server has TCP enabled.

D. Try ping your remote server machine, name and ipaddress.

E. Try to telnet <remoterservername> <portnumber>

F. Try to access a share of your remote server.

If above list all passed, you should be able to connect to linked server unless other problem exists, normally, you could see event log or server log to get clue.

Good Luck!

Ming.

|||Ming,

Thank you for your response. Will try it and let you know.

Thanks again|||Hey Ming,

I gave what you suggested a go, but I still get the error when I access CR XI from .Net 2003. I have connection to the DB server, and I am able to run the CR XI on a stand alone bases, but when it come to accessing from .Net 2003 Web App, I get the error.

Thank again for your idea|||

I recommend reading http://msdn2.microsoft.com/en-us/library/ms227528.aspx regarding how to setup Crystal Reports to connect to SQL Server tutorial.

Since are you able to run the CR XI on standalone, sounds like your Web App config is wrong.
Please post the config setting for your web app.

Jimmy

|||Hi Jimmy -

As requested, here is a copy of my web.config file

<?xml version="1.0" encoding="utf-8"?>
<configuration>

<system.web>

<compilation defaultLanguage="c#" debug="true"><assemblies><add assembly="CrystalDecisions.CrystalReports.Engine, Version=11.0.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.ReportSource, Version=11.0.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Shared, Version=11.0.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Web, Version=11.0.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=11.0.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Enterprise.Framework, Version=11.0.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Enterprise.InfoStore, Version=11.0.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Enterprise.Web, Version=11.0.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></assemblies></compilation>

<customErrors mode="RemoteOnly"/>

<authentication mode="Windows"/>

<authorization>
<allow users="*"/>

</authorization>

<trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true"/>

<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20"/>

<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>

</system.web>

</configuration>

I will read over the documentation, and let you know if this error gets firgured out.

Thank you

.Net 2003 access Crystal Report XI: Error:Failed to open the connection: [Database Vendor Co

I am receving this error: Failed to open the connection: [Database Vendor Code: 17 ], from .Net 2003/C# to Crystal Report XI with SQL Server 2000 has backend database.

Is there a security permission that has been overlooked?

Here is the code I use to access CR XI

ConnectionInfo connectionInfo = new ConnectionInfo();
TableLogOnInfo tableLogOnInfo;
Database DB;
'CrystalDecisions.CrystalReports.Engine.Table' table;
Tables tables;

//Log in
connectionInfo.ServerName = "ServerName";
connectionInfo.DatabaseName = "Database Namet";
connectionInfo.UserID = "userid";
connectionInfo.Password = "password";

//Get Table inf from report
DB = reportDocument..Database;
tables = DB.Tables;


//Looping through all the tables in CR and apply connection info
for(int i = 0; i < tables.Count; i++)
{
table = tables[ i ];
tableLogOnInfo = table.LogOnInfo;
tableLogOnInfo.ConnectionInfo = connectionInfo;
table.ApplyLogOnInfo(tableLogOnInfo);

}

CrystalReportViewer.ReportSource = ReportDocument.ReportSource;
CrystalReportViewer.Visible = true;

Any advise would be helpful.
Thank you

Hi, Koolaidbomber

First, try to find osql.exe on your client box, "c:\program files\microsoft sql server\80\tools\binn", osql.exe /S<servermachine> /E, or "osql.exe /S<servermachine>\<Instancename> /E"( the latter is for named instance). would you also get the same error? For remote connection specific you need following checklist:

A. Enable "File and printer sharing" in Firewall if your server is behind that.

B. Add program "sqlbrowser.exe" or udp port "1434" in your firewall exception list.

C. Add tcp port "1433" of default instance or <port number> of named instance in firewall, check you errorlog to figure out which port server is listening on. If you want your connection over TCP and make sure your server has TCP enabled.

D. Try ping your remote server machine, name and ipaddress.

E. Try to telnet <remoterservername> <portnumber>

F. Try to access a share of your remote server.

If above list all passed, you should be able to connect to linked server unless other problem exists, normally, you could see event log or server log to get clue.

Good Luck!

Ming.

|||Ming,

Thank you for your response. Will try it and let you know.

Thanks again|||Hey Ming,

I gave what you suggested a go, but I still get the error when I access CR XI from .Net 2003. I have connection to the DB server, and I am able to run the CR XI on a stand alone bases, but when it come to accessing from .Net 2003 Web App, I get the error.

Thank again for your idea|||

I recommend reading http://msdn2.microsoft.com/en-us/library/ms227528.aspx regarding how to setup Crystal Reports to connect to SQL Server tutorial.

Since are you able to run the CR XI on standalone, sounds like your Web App config is wrong.
Please post the config setting for your web app.

Jimmy

|||Hi Jimmy -

As requested, here is a copy of my web.config file

<?xml version="1.0" encoding="utf-8"?>
<configuration>

<system.web>

<compilation defaultLanguage="c#" debug="true"><assemblies><add assembly="CrystalDecisions.CrystalReports.Engine, Version=11.0.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.ReportSource, Version=11.0.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Shared, Version=11.0.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Web, Version=11.0.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=11.0.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Enterprise.Framework, Version=11.0.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Enterprise.InfoStore, Version=11.0.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Enterprise.Web, Version=11.0.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></assemblies></compilation>

<customErrors mode="RemoteOnly"/>

<authentication mode="Windows"/>

<authorization>
<allow users="*"/>

</authorization>

<trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true"/>

<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20"/>

<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>

</system.web>

</configuration>

I will read over the documentation, and let you know if this error gets firgured out.

Thank you

Friday, February 24, 2012

.CreateReport using another credentials

I have an asp/asp.net application that uses forms authentication to
autheticate to the report server. My app constructs the url to access the
reports. No one has access to the report manager. Everything works great.
Now I've created a .net module that gets a report from the report server,
modifies it and deployes back to another folder. Its like an ad hoc solution.
For security reasons each role only has "View Report" permission. To do all
the backend stuff described in my "ad hoc" solution i'm forced to grant more
permissions such as create, delete datasources, reports to these roles. Is it
possible to programmically logon as a another user, get the report, modify it
and redeploy(.createReport)? This way my module has permissions to do this
and not the user. I'm using forms authentications. Does this make sense?found a solution:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsprog/htm/rsp_ref_soapapi_service_lz_3d7q.asp
"Marvin" wrote:
> I have an asp/asp.net application that uses forms authentication to
> autheticate to the report server. My app constructs the url to access the
> reports. No one has access to the report manager. Everything works great.
> Now I've created a .net module that gets a report from the report server,
> modifies it and deployes back to another folder. Its like an ad hoc solution.
> For security reasons each role only has "View Report" permission. To do all
> the backend stuff described in my "ad hoc" solution i'm forced to grant more
> permissions such as create, delete datasources, reports to these roles. Is it
> possible to programmically logon as a another user, get the report, modify it
> and redeploy(.createReport)? This way my module has permissions to do this
> and not the user. I'm using forms authentications. Does this make sense?

Sunday, February 19, 2012

*Passing parameters to an SP*

Hi
I need to embed Reports into an aspx page.
So I need to send parameters to the Report from the UI (aspx page).
I can do this using parameterized reports but I want to pass the parameters from the aspx page and not the report body .
Can anyone suggest how to do that.
Moreover in my application I have a Data Access Layer which is to be used to call the SPs. We dont call the SP directly. Then this Data Access layer returns the dataset.
Is it possible to integrate Reporting Services in such an architecture. I want this layer to get values from the Database otherwise I see calling the SP directly as the only option.
Thanks in advance
--
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.In Brian Larson's book there is an example of how to use aspx pages to call
RS. (Chapter 12)
http://www.osborne.com/products/0072232161/0072232161_code.zip
Regards,
Cem
"SqlJunkies User" <User@.-NOSPAM-SqlJunkies.com> wrote in message
news:eFyl4etWEHA.3476@.tk2msftngp13.phx.gbl...
> Hi
> I need to embed Reports into an aspx page.
> So I need to send parameters to the Report from the UI (aspx page).
> I can do this using parameterized reports but I want to pass the
parameters from the aspx page and not the report body .
> Can anyone suggest how to do that.
> Moreover in my application I have a Data Access Layer which is to be used
to call the SPs. We dont call the SP directly. Then this Data Access layer
returns the dataset.
> Is it possible to integrate Reporting Services in such an architecture. I
want this layer to get values from the Database otherwise I see calling the
SP directly as the only option.
> Thanks in advance
>
> --
> Posted using Wimdows.net NntpNews Component -
> Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine
supports Post Alerts, Ratings, and Searching.|||Cem Demircioglu wrote:
> In Brian Larson's book there is an example of how to use aspx pages
> to call RS. (Chapter 12)
> http://www.osborne.com/products/0072232161/0072232161_code.zip
> Regards,
> Cem
IMHO the sample code in ReportFrontEnd.aspx.vb has a minor error. In my
experience the call to
HttpContext.Current.Response.End()
within a try-catch block will _always_ end up in an exception of the kind
"the thread has been interrupted" or so.
Instead of coding
...
' Send the byte array containing the report as a binary response.
HttpContext.Current.Response.BinaryWrite(report)
HttpContext.Current.Response.End()
Catch ex As Exception
HttpContext.Current.Response.ClearHeaders()
HttpContext.Current.Response.ClearContent()
HttpContext.Current.Response.ContentType = "text/html"
HttpContext.Current.Response.Write("&
Error"
& ex.Message & "
")
HttpContext.Current.Response.End()
End Try
one should use
' Send the byte array containing the report as a binary response.
HttpContext.Current.Response.BinaryWrite(report)
Catch ex As Exception
HttpContext.Current.Response.ClearHeaders()
HttpContext.Current.Response.ClearContent()
HttpContext.Current.Response.ContentType = "text/html"
HttpContext.Current.Response.Write("<HTML><BODY><H1>Error</H1><br><br>"
& ex.Message & "</BODY></HTML>")
End Try
HttpContext.Current.Response.End()
... means keep the HttpContext.Current.Response.End() out of a try-catch
block.
roland