Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check Printing using SSRS 2005 and VB.Net 2005

Status
Not open for further replies.

ousoonerjoe

Programmer
Jun 12, 2007
925
0
0
US
How would you go about creating an SSRS 2005 report to preview/review/and print checks? The check page is standard 8 1/2 x 11 paper with the top 1/3 for the check and bottom 2/3 for invoice items. Catch-- the invoice items may exceed the space allocated on the first page and need to role over to the 2nd page. The check area for each page after the first check would have to be marked as "VOID". I could work out how to do it on a "One Check At a Time" basis, but what about for batch? We may need to issue 500 checks in one day. Printing them singularly is not practical. We also need the batch of checks to be written to PDF for Accounting. The master application that will call the Server-Side report is in VB.Net 2005.

I'd like to be able to just attach the Stored Procedure to the report and call the report with arguments via the main application. The coding isn't so much the problem as it is the logic on the check forms.

How do you get the excessive line items to carry over to the next page and not print the check again?

How do you handle the page numbers to be of that check/invoice rather than the entire batch?

(NOTE: I will be printing the MICR/CheckNum/etc on the page, so no need to worry about that.)

I have all ready tried posting this in the Microsoft SQL Server: Reporting Services Forum to no avail. So any thoughts, ideas, comments and random bits of insanity are welcome.

Thank you.

"If I were to wake up with my head sewn to the carpet, I wouldn't be more surprised than I am right now.
 
This is code I use to export to a PDF file. You will need to replace "reportserver" with your report server name. This report has four parameters; you may not need those. I'm not sure about the rest of your questions; I will have to think about those.
Code:
Dim rs As New reportserver.ReportingService
Dim rpt As String
Dim resultStream As Byte()
Dim streamIdentifiers() As String = Nothing
Dim historyID As String = Nothing
Dim devInfo As String = "<DeviceInfo><StreamRoot>/RSWebServiceXS/</StreamRoot></DeviceInfo>"
Dim parameters(4) As reportserver.ParameterValue
Dim credentials As reportserver.DataSourceCredentials() = Nothing
Dim showHideToggle As String = Nothing
Dim encoding As String = Nothing
Dim mimeType As String = Nothing
Dim warnings As reportserver.Warning() = Nothing
Dim reportHistoryParams As reportserver.ParameterValue() = Nothing
Dim optionalWarnings As reportsserver.Warning() = Nothing
Dim acrobatProcess As New Process

rs.Credentials = System.Net.CredentialCache.DefaultCredentials

'Prepare the report parameters
parameters(0) = New reportserver.ParameterValue
parameters(0).Name = "Frequency"
parameters(0).Value = frequency

parameters(1) = New reportserver.ParameterValue
parameters(1).Name = "OutputType"
parameters(1).Value = outputType

parameters(2) = New reportserver.ParameterValue
parameters(2).Name = "BillToCode"
parameters(2).Value = billToCode

parameters(3) = New reportserver.ParameterValue
parameters(3).Name = "CustomerCode"
parameters(3).Value = customerCode

parameters(4) = New reportserver.ParameterValue
parameters(4).Name = "CustomerName"
parameters(4).Value = customerName

'Render the report as PDF
rpt = "/" + My.Settings.RptFolder + "/" & My.Settings.RptName
resultStream = rs.Render(rpt, "PDF", historyID, devInfo, parameters, credentials, showHideToggle, encoding, mimeType, reportHistoryParams, warnings, streamIdentifiers)

'Write the report to a file
Dim newStream As Stream
newStream = File.Create(strPDFFileName)
newStream.Write(resultStream, 0, resultStream.Length)
newStream.Close()

Andrea
 
Thank you Andrea. That'll help me get the PDF side take care of.

I have posted the formatting results that i have so far in this thread: thread1462-1502777 for cross reference.

"If I were to wake up with my head sewn to the carpet, I wouldn't be more surprised than I am right now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top