Showing posts with label delivery. Show all posts
Showing posts with label delivery. Show all posts

Tuesday, March 27, 2012

Customized Delivery Extension

I am developing a customized delivery extension and I am trying to
write the stream renderedoutputfile[] to a file on the server. When I
write it to a file, the file is blank with a bunch of spaces in it. Do
I need to decode the Stream? Any help would be great.
Here is the code I am using.
This is inside the Delivery Method..
deviceInfo = String.Format(@."<DeviceInfo><OutputFormat>{0}</OutputFormat></DeviceInfo>","PDF");
// Render report
files = notification.Report.Render("PDF",deviceInfo);
BinaryReader br = new BinaryReader(m_files[0].Data);
byte[] byteData = new byte[(int)m_files[0].Data.Length];
int j = br.Read(byteData,0, (int)m_files[0].Data.Length);
FileStream fst = new FileStream(@."c:\temp\test.pdf", FileMode.Append,
FileAccess.Write);
BinaryWriter writer = new BinaryWriter(fst);
writer.Write(byteData,0,byteData.Length);
writer.Flush();
writer.Close();
What I am doing wrong? Code is in c#.Is it as simple as:
files = notification.Report.Render("PDF",deviceInfo);
=> note you're writing to local variable files
BinaryReader br = new BinaryReader(m_files[0].Data);
=> note you're reading from member variable m_files
-Lukasz
This posting is provided "AS IS" with no warranties, and confers no rights.
"jason" <obryan7@.hotmail.com> wrote in message
news:d16403e7.0407180926.620e1a79@.posting.google.com...
> I am developing a customized delivery extension and I am trying to
> write the stream renderedoutputfile[] to a file on the server. When I
> write it to a file, the file is blank with a bunch of spaces in it. Do
> I need to decode the Stream? Any help would be great.
> Here is the code I am using.
> This is inside the Delivery Method..
> deviceInfo =String.Format(@."<DeviceInfo><OutputFormat>{0}</OutputFormat></DeviceInfo>","
PDF");
> // Render report
> files = notification.Report.Render("PDF",deviceInfo);
> BinaryReader br = new BinaryReader(m_files[0].Data);
> byte[] byteData = new byte[(int)m_files[0].Data.Length];
> int j = br.Read(byteData,0, (int)m_files[0].Data.Length);
> FileStream fst = new FileStream(@."c:\temp\test.pdf", FileMode.Append,
> FileAccess.Write);
> BinaryWriter writer = new BinaryWriter(fst);
> writer.Write(byteData,0,byteData.Length);
> writer.Flush();
> writer.Close();
> What I am doing wrong? Code is in c#.

Thursday, March 8, 2012

Custom Fax Delivery Extension

Hello All:
We have setup Reporting Services. I want to integrate it with Fax server for
creating new subsciptions using custom delivery extension.
Apart from this custom extension, I am having one more solution for this
scenario and that is sending email (in the format <fax number>@.<fax server
name>) to the fax server as it is on SMTP.
I have not tested this scenario but from some search on net on this topic
brought out this solution. I am not sure whether sending email to the Fax
server (as it is on SMTP) will be right solution.
And if this is the solution then why do we need to write Custom fax Delivery
Extension? Any help or sample code or steps in this regards will be highly
appreciated
RohitIf you have an eamil address that works like a fax server, then you can make
a subscription to the report and email it... However there is no USER
Rendering agent for fax server, so a user can not run the report, then
export it to a fax server unless you write a custom extension..
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Rohit Patil" <Rohit Patil@.discussions.microsoft.com> wrote in message
news:86A1792C-506D-4BBE-A06F-7DB888FE7036@.microsoft.com...
> Hello All:
> We have setup Reporting Services. I want to integrate it with Fax server
> for
> creating new subsciptions using custom delivery extension.
> Apart from this custom extension, I am having one more solution for this
> scenario and that is sending email (in the format <fax number>@.<fax server
> name>) to the fax server as it is on SMTP.
> I have not tested this scenario but from some search on net on this topic
> brought out this solution. I am not sure whether sending email to the Fax
> server (as it is on SMTP) will be right solution.
> And if this is the solution then why do we need to write Custom fax
> Delivery
> Extension? Any help or sample code or steps in this regards will be highly
> appreciated
> Rohit|||Hello Wayne,
Thanks for the reply. I have database of external users to whom the report
from reporting server is to be faxed. So depending upon the subscription made
report will be sent to different fax numbers. I am testing for the
functionality of fax server to send fax to different numbers, but I think I
have to write fax extension. If Ic an et some sample code for it then it will
be of real great help.
Rohit
"Wayne Snyder" wrote:
> If you have an eamil address that works like a fax server, then you can make
> a subscription to the report and email it... However there is no USER
> Rendering agent for fax server, so a user can not run the report, then
> export it to a fax server unless you write a custom extension..
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Rohit Patil" <Rohit Patil@.discussions.microsoft.com> wrote in message
> news:86A1792C-506D-4BBE-A06F-7DB888FE7036@.microsoft.com...
> > Hello All:
> > We have setup Reporting Services. I want to integrate it with Fax server
> > for
> > creating new subsciptions using custom delivery extension.
> >
> > Apart from this custom extension, I am having one more solution for this
> > scenario and that is sending email (in the format <fax number>@.<fax server
> > name>) to the fax server as it is on SMTP.
> >
> > I have not tested this scenario but from some search on net on this topic
> > brought out this solution. I am not sure whether sending email to the Fax
> > server (as it is on SMTP) will be right solution.
> >
> > And if this is the solution then why do we need to write Custom fax
> > Delivery
> > Extension? Any help or sample code or steps in this regards will be highly
> > appreciated
> >
> > Rohit
>
>

Wednesday, March 7, 2012

Custom Delivery for Printer

Hi,
For Reporting Services for SQL Server 2000, we need to write a custom
delivery dll for printer right?
Just wondering has microsoft come out with a sample of it already? Maybe a
sample code or a working DLL already?
Best Regards,
ShelA printer delivery sample shipped with RS 2000. If you run setup you can
install the samples. There is help for the sample in the help
documentation.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"Shelby" <shelby@.singnet.com.sg> wrote in message
news:OiSAqH%23AGHA.516@.TK2MSFTNGP15.phx.gbl...
> Hi,
> For Reporting Services for SQL Server 2000, we need to write a custom
> delivery dll for printer right?
> Just wondering has microsoft come out with a sample of it already? Maybe a
> sample code or a working DLL already?
> Best Regards,
> Shel
>

Custom Delivery Extension - SubscriptionID

I am attempting to implement a custom delivery extension for SSRS 2000. The custom delivery extension will deliver the report to a database(table). CreateSubscription WebMethod returns a SubscriptionID once a subscription is created. Is it possible to get this SubscriptionID at run-time i.e when the IDeliveryExtension.Deliver method is called? If so, how? I want to store the SubscriptionID with the report in the database. Thanks for your help.

Hi

I had the same question .

please help us.

Custom Delivery Extension - SubscriptionID

I am attempting to implement a custom delivery extension for SSRS 2000. The custom delivery extension will deliver the report to a database(table). CreateSubscription WebMethod returns a SubscriptionID once a subscription is created. Is it possible to get this SubscriptionID at run-time i.e when the IDeliveryExtension.Deliver method is called? If so, how? I want to store the SubscriptionID with the report in the database. Thanks for your help.

Hi

I had the same question .

please help us.

Custom Delivery Extension

SSRS2000 - Is it possible to combine two existing delivery extensions into one custom delivery extension? If possible, I would like to combine file share and email delivery extensions to send email after file has been created by the file share delivery extension. Any help will be much appreciated.

Thanks

Sorry, no this is not possible. You would have to write your own extension that does the same thing.

All is not lost however: If you enable caching for the report, it should be possible to create two subscription that fire at the same time based on a shared schedule that deliver the same report (due to caching) to different locations.

-Lukasz

|||KKaps-

Although they can't be combined, you could create your own custom

delivery extension that does both functions. Take a look at the

PrinterDeliverySample to get started with creating delivery extensions.

Regards,

Scott

Custom Delivery Extension

SSRS2000 - Is it possible to combine two existing delivery extensions into one custom delivery extension? If possible, I would like to combine file share and email delivery extensions to send email after file has been created by the file share delivery extension. Any help will be much appreciated.

Thanks

Sorry, no this is not possible. You would have to write your own extension that does the same thing.

All is not lost however: If you enable caching for the report, it should be possible to create two subscription that fire at the same time based on a shared schedule that deliver the same report (due to caching) to different locations.

-Lukasz

|||KKaps-

Although they can't be combined, you could create your own custom delivery extension that does both functions. Take a look at the PrinterDeliverySample to get started with creating delivery extensions.

Regards,
Scott

Custom Delivery Extension

Hi,
I have successfully created a custom data renderer(report to form) and a
data extension.
I need to create a custom delivery extension that will check if the reports
is returning data before delivering it.
Any pointers.....
Thanks
MandarUnfortunately the delivery extension API doesn't expose any mechanism for
knowing if the report contained data or not. The only work around is to use
data driven subscriptions such that the query for the subscription returns
no rows if the report will have no data.
If the delivery extension does not have to be generic, it could be written
to have knowledge of the reports and do some checking on its own.
This feature has been requested a lot and is on the list for consideration
for a future release.
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"IB Ghost" <ibghost@.hotmail.com> wrote in message
news:uD2hhfwSFHA.3312@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I have successfully created a custom data renderer(report to form) and a
> data extension.
> I need to create a custom delivery extension that will check if the
> reports
> is returning data before delivering it.
> Any pointers.....
> Thanks
> Mandar
>
>
>|||Hi Daniel,
Thanks for your response.
I have installed the PrinterDeliveryExtension sample.
The Webserver/ReportServer & SQL Server are installed on the same machine.
I am using RS SP2 and am able to use the print functionality in the
ReportViewer.
I tried adding the printer name in the RSWebApplication.config file &
RSReportServer.config under the Delivery tag.
The printer is a network printer installed in another machine & I had given
the path as "\\anothermachinename\printername".
This was giving me an error while setting up the subscription itself, saying
printer not found.
I have modified the code in the PrinterDeliveryProvider.vb file,
function-SetConfiguration().
Here instead of reading the printer names from the config files, I am using
the PrintDocument object to pick up all the printers on the network
programmatically.
I can see the list of all the printers on the network on the subscription
page in the "Select Printer" dropdown, and can now create the subscription.
But when the subscription runs the status says "The printer
\\anothermachinename\printername is not currently
installed on the server."
Any ideas on this.
Regards
Mandar Pai
mandarp@.infobahnlimited.com; mandarpai@.hotmail.com
"Daniel Reib (MSFT)" <danreib@.online.microsoft.com> wrote in message
news:ud5tZ55SFHA.2172@.tk2msftngp13.phx.gbl...
> Unfortunately the delivery extension API doesn't expose any mechanism for
> knowing if the report contained data or not. The only work around is to
use
> data driven subscriptions such that the query for the subscription returns
> no rows if the report will have no data.
> If the delivery extension does not have to be generic, it could be written
> to have knowledge of the reports and do some checking on its own.
> This feature has been requested a lot and is on the list for consideration
> for a future release.
>
> --
> -Daniel
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "IB Ghost" <ibghost@.hotmail.com> wrote in message
> news:uD2hhfwSFHA.3312@.TK2MSFTNGP12.phx.gbl...
> > Hi,
> >
> > I have successfully created a custom data renderer(report to form) and a
> > data extension.
> >
> > I need to create a custom delivery extension that will check if the
> > reports
> > is returning data before delivering it.
> >
> > Any pointers.....
> >
> > Thanks
> >
> > Mandar
> >
> >
> >
> >
> >
> >
>|||This is just a guess, but when the subscription runs it runs as the service
user. Perhaps this user does not have permission to see the network
printer. Try giving them permission.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"IB Ghost" <ibghost@.hotmail.com> wrote in message
news:%23QU7%23F8SFHA.2560@.TK2MSFTNGP10.phx.gbl...
> Hi Daniel,
> Thanks for your response.
> I have installed the PrinterDeliveryExtension sample.
> The Webserver/ReportServer & SQL Server are installed on the same machine.
> I am using RS SP2 and am able to use the print functionality in the
> ReportViewer.
> I tried adding the printer name in the RSWebApplication.config file &
> RSReportServer.config under the Delivery tag.
> The printer is a network printer installed in another machine & I had
> given
> the path as "\\anothermachinename\printername".
> This was giving me an error while setting up the subscription itself,
> saying
> printer not found.
> I have modified the code in the PrinterDeliveryProvider.vb file,
> function-SetConfiguration().
> Here instead of reading the printer names from the config files, I am
> using
> the PrintDocument object to pick up all the printers on the network
> programmatically.
> I can see the list of all the printers on the network on the subscription
> page in the "Select Printer" dropdown, and can now create the
> subscription.
> But when the subscription runs the status says "The printer
> \\anothermachinename\printername is not currently
> installed on the server."
>
> Any ideas on this.
> Regards
> Mandar Pai
> mandarp@.infobahnlimited.com; mandarpai@.hotmail.com
> "Daniel Reib (MSFT)" <danreib@.online.microsoft.com> wrote in message
> news:ud5tZ55SFHA.2172@.tk2msftngp13.phx.gbl...
>> Unfortunately the delivery extension API doesn't expose any mechanism for
>> knowing if the report contained data or not. The only work around is to
> use
>> data driven subscriptions such that the query for the subscription
>> returns
>> no rows if the report will have no data.
>> If the delivery extension does not have to be generic, it could be
>> written
>> to have knowledge of the reports and do some checking on its own.
>> This feature has been requested a lot and is on the list for
>> consideration
>> for a future release.
>>
>> --
>> -Daniel
>> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>>
>> "IB Ghost" <ibghost@.hotmail.com> wrote in message
>> news:uD2hhfwSFHA.3312@.TK2MSFTNGP12.phx.gbl...
>> > Hi,
>> >
>> > I have successfully created a custom data renderer(report to form) and
>> > a
>> > data extension.
>> >
>> > I need to create a custom delivery extension that will check if the
>> > reports
>> > is returning data before delivering it.
>> >
>> > Any pointers.....
>> >
>> > Thanks
>> >
>> > Mandar
>> >
>> >
>> >
>> >
>> >
>> >
>>
>

Custom Delivery Extension

Hello Everyone,
I'm in the process of creating a custom delivery extension that will
write to a file share and then email users that the file is available.
I have used the custom printing extension sample as the basis for
creating my FileShareEmail extension.
I think my question is unlike most posted here in that, I have gotten
all the config files to work. So far I have set up a few parameters
(email address to and from). I then send an email with smtp.
I successfully receive the email and I created the notification.Status
= "Status: Email Sent.". This is what i see in the log file:
ReportingServicesService!notification!3ffc!11/02/2005-09:42:06::
Notification 7493a45c-2f0b-431c-bb53-592a99a5977c completed. Success:
False, Status: Email Sent., DeliveryExtension: File Share Email,
Report: 01 - Standard Listing Report, Attempt 1
There are no exceptions and the email was sent. The Report Manager
still has Done: 1 processed of 1 total; 1 errors. in the status column.
I cannot figure out why there was an error generated. Is there a
property that i forgot to set?
Another question I have is: I can see my custom extension in data
driven subscriptions but not in the regular subscriptions. Is this by
design or am I missing a config.
Resources question: I've looked quite a few places for some more
examples (other than the printer example), does anyone know some good
blogs or sites that have some different samples implemented?
The fourth and final question: Since I am trying to replicate some of
the existing functionality of RS, is there a way to send the email
through RS instead of coding my own error checking and such into my
extension?
Thanks for your help!
Regards,
DanI figured out one of the 4 questions. My Deliver() method was
returning the wrong boolean value (i.e. true when failed and false when
succeeded).

Custom Delivery Extension

Hi,
I'm writing a custom delivery extension that saves the rendered report
to the disk.
My problem is that the output file only contains spaces (the file size
is excatly what it should be but no text only black spaces).
Does anyone know why spaces appear instead of chars ?
this is the code for excel but the same happens with mhtml:
Dim deviceInfo, format As String
format = "EXCEL"
deviceInfo = String.Format("<DeviceInfo><OutputFormat>{0}</OutputFormat></DeviceInfo>",
format)
' Render report
m_files = notification.Report.Render(format, deviceInfo)
Dim fileName As String
fileName = "C:\" & m_files(0).FileName & ".xls"
Dim results(CInt(m_files(0).Data.Length)) As Byte
m_files(0).Data.Read(results, 0, CInt(m_files(0).Data.Length))
Dim _filestream As System.IO.FileStream = System.IO.File.OpenWrite(fileName)
_filestream.Write(results, 0, CInt(m_files(0).Data.Length))
_filestream.Flush()
_filestream.Close()You need to take the encoding of the stream into account. Use a stream
reader to read the contents passing in the encoding of the stream, and then
use a stream writer to write to the filestream, also passing in the
encoding.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"kman" <kamara1@.yahoo.com> wrote in message
news:1106326857.837797.301490@.z14g2000cwz.googlegroups.com...
> Hi,
> I'm writing a custom delivery extension that saves the rendered report
> to the disk.
> My problem is that the output file only contains spaces (the file size
> is excatly what it should be but no text only black spaces).
> Does anyone know why spaces appear instead of chars ?
> this is the code for excel but the same happens with mhtml:
> Dim deviceInfo, format As String
> format = "EXCEL"
> deviceInfo => String.Format("<DeviceInfo><OutputFormat>{0}</OutputFormat></DeviceInfo>",
> format)
> ' Render report
> m_files = notification.Report.Render(format, deviceInfo)
> Dim fileName As String
> fileName = "C:\" & m_files(0).FileName & ".xls"
> Dim results(CInt(m_files(0).Data.Length)) As Byte
> m_files(0).Data.Read(results, 0, CInt(m_files(0).Data.Length))
> Dim _filestream As System.IO.FileStream => System.IO.File.OpenWrite(fileName)
> _filestream.Write(results, 0, CInt(m_files(0).Data.Length))
> _filestream.Flush()
> _filestream.Close()
>|||Thanks,
I tried what you've suggested but i think i'm doing something wrong
because now i'm getting a zero byte file.
can you provide the code for that?
here's the code i added:
Dim encode As Encoding = m_files(0).Encoding
Dim _readStream As New StreamReader(m_files(0).Data, encode)
Dim _filestream As New System.IO.FileStream(fileName,
FileMode.OpenOrCreate)
Dim _writeStream As New StreamWriter(_filestream, encode)
_writeStream.Write(_readStream.ReadToEnd)
_writeStream.Close()
_readStream.Close()
_FileStream.Close()|||Daniel, somebody,
Please help ...|||You're correct - for excel there's no encoding. I tried the mhtml
format which has ASCIIEncoding.
I'm only sending the format in the device info:
String.Format("<DeviceInfo><OutputFormat>{0}</OutputFormat></DeviceInfo>",format)
I'm not sure what you mean to pass via url, i've tried to export the
report from the report manager and it works fine.
Can you post how to read it like you do ?|||Try not passing in this device info and instead pass the format in on the
render call only.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"kman" <kamara1@.yahoo.com> wrote in message
news:1106853884.827838.300370@.z14g2000cwz.googlegroups.com...
> You're correct - for excel there's no encoding. I tried the mhtml
> format which has ASCIIEncoding.
> I'm only sending the format in the device info:
> String.Format("<DeviceInfo><OutputFormat>{0}</OutputFormat></DeviceInfo>",format)
> I'm not sure what you mean to pass via url, i've tried to export the
> report from the report manager and it works fine.
> Can you post how to read it like you do ?
>|||i tried - notification.Report.Render(format, Nothing), but still
there's a black file.
i checked the findrendersave sample and it works fine there but i can't
use the render method directly from the web service because i need the
subscription info (parameters ...)
any ideas ?|||I'm sorry to say, I don't see what the problem is. I can't see anything
wrong with what you are doing. It should work.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"kman" <kamara1@.yahoo.com> wrote in message
news:1106909217.659089.277880@.z14g2000cwz.googlegroups.com...
>i tried - notification.Report.Render(format, Nothing), but still
> there's a black file.
> i checked the findrendersave sample and it works fine there but i can't
> use the render method directly from the web service because i need the
> subscription info (parameters ...)
> any ideas ?
>|||Hi,
Solved it. It wasn't the encoding after all but the position on the
data stream.
I added this line and it solved it:
_renderedOutputFile.Data.Seek(CType(0, Long),
System.IO.SeekOrigin.Begin)
Thanks for your help.
This is the complete code for saving the file (works for excel, mhtml
and pdf):
m_files = notification.Report.Render(format, Nothing)
Dim _fileStream As System.IO.FileStream = Nothing
Dim _renderedOutputFile As RenderedOutputFile
_renderedOutputFile = m_files(0)
Dim fileName As String = "C:\" & _renderedOutputFile.FileName.Trim &
"." & _renderedOutputFile.Extension.Trim
_fileStream = New System.IO.FileStream(fileName, FileMode.OpenOrCreate,
FileAccess.Write)
_renderedOutputFile.Data.Seek(CType(0, Long),
System.IO.SeekOrigin.Begin)
Dim arr(CInt(_renderedOutputFile.Data.Length)) As Byte
_renderedOutputFile.Data.Read(arr, 0,
CInt(_renderedOutputFile.Data.Length))
_fileStream.Write(arr, 0, CInt(_renderedOutputFile.Data.Length))
_fileStream.Close()