Connecting Tech Pros Worldwide Help | Site Map

Reporting services and appending multiple documents

Newbie
 
Join Date: Jan 2007
Posts: 3
#1: Jan 24 '07
Ok not sure if this is where im meant to post my problem. But currently i'm generating a report through a webpage coded using vb.net.

I create the reporitng service and set the credentials and then set the render arguments. i then call the reportingservices.render method to generate the report which all works fine. Currently the report takes in one paramater, in this case a invoice number and the report returned is an invoice. The report returned is a PDF file.

Now i'm wondering is there anyway to have the reporting service recieve multiple invoice numbers as a parameter and in return prints ALL invoices into one pdf file?
radcaesar's Avatar
Moderator
 
Join Date: Sep 2006
Posts: 756
#2: Jan 24 '07

re: Reporting services and appending multiple documents


That is not the task of reporting services. Thats ur logic. You can achieve this in crystal reports itself. Else try with Farpoint.

:)
Newbie
 
Join Date: Jan 2007
Posts: 3
#3: Jan 24 '07

re: Reporting services and appending multiple documents


Hey thanks for the reply, i started thinking about this and now im not sure if this will work. But the render method returns a byte array so i tried to render two reports and return it in Byte1 and Byte2 arrays. Then i declared a filestream and created a file with the length of both these arrays lengths. THen i tried to call the Write method and write the two bytes into the file. Would this work?
I've got the following code

Two byte arrays which have been rendered and then

Dim length As Integer = Data.Length + Data2.Length

Dim stream As FileStream = File.Create("report.pdf", length)

stream.Write(Data, 0, Data.Length)

stream.Write(Data2, Data.Length length)

stream.Close()
Member
 
Join Date: Jan 2007
Posts: 86
#4: Jan 24 '07

re: Reporting services and appending multiple documents


I don't think this is possible. There are several 3rd party solutions (see this link for a discussion of one that works with Crystal Reports: http://aspalliance.com/571_Merging_a...rystal_Reports) that can accomplish this task. I like your creativity, though!

Quote:

Originally Posted by Someone11

Hey thanks for the reply, i started thinking about this and now im not sure if this will work. But the render method returns a byte array so i tried to render two reports and return it in Byte1 and Byte2 arrays. Then i declared a filestream and created a file with the length of both these arrays lengths. THen i tried to call the Write method and write the two bytes into the file. Would this work?
I've got the following code

Two byte arrays which have been rendered and then

Dim length As Integer = Data.Length + Data2.Length

Dim stream As FileStream = File.Create("report.pdf", length)

stream.Write(Data, 0, Data.Length)

stream.Write(Data2, Data.Length length)

stream.Close()

Newbie
 
Join Date: Jan 2007
Posts: 3
#5: Jan 24 '07

re: Reporting services and appending multiple documents


lol im still new to all this and i dont know whats possible.
But i cant use crystal reports as we already have all our reports written using sql reporting services. I'm sure if you have two byte arrays you can just combine it and get it to display?
Member
 
Join Date: Jan 2007
Posts: 86
#6: Jan 26 '07

re: Reporting services and appending multiple documents


Try looking into the following:

http://forums.microsoft.com/MSDN/Sho...39828&SiteID=1

Quote:

Originally Posted by Someone11

lol im still new to all this and i dont know whats possible.
But i cant use crystal reports as we already have all our reports written using sql reporting services. I'm sure if you have two byte arrays you can just combine it and get it to display?

Newbie
 
Join Date: Dec 2006
Posts: 3
#7: Jun 12 '07

re: Reporting services and appending multiple documents


Would it not be possible for you to change the parameters for report and, instead of taking a single id, accept a string. Then, your SQL query could return multiple invoices by doing a :

select
*
from
invoice_table t
where
t.id in (@parameterIDString)

instead of

select
*
from
invoice_table t
where
t.id = (@parameterID)

Not sure if that helps, but I've done that before and gotten it to work.
Newbie
 
Join Date: Dec 2007
Posts: 1
#8: Dec 10 '07

re: Reporting services and appending multiple documents


Hi everyone.

I rendered two reports to PDF, joined the two byte arrays into one, created a FileStream and write the byte array that contains the reports into the file. The file is created with the correct length but, when I open the PDF, it only shows the last report. Does anyone have a solution for this?

Thanks,
Aligieri


Quote:

Originally Posted by Someone11

Hey thanks for the reply, i started thinking about this and now im not sure if this will work. But the render method returns a byte array so i tried to render two reports and return it in Byte1 and Byte2 arrays. Then i declared a filestream and created a file with the length of both these arrays lengths. THen i tried to call the Write method and write the two bytes into the file. Would this work?
I've got the following code

Two byte arrays which have been rendered and then

Dim length As Integer = Data.Length + Data2.Length

Dim stream As FileStream = File.Create("report.pdf", length)

stream.Write(Data, 0, Data.Length)

stream.Write(Data2, Data.Length length)

stream.Close()

Reply