Send report direct to printer without preview

Stimulsoft Ultimate discussion
pdt1704
Posts: 60
Joined: Tue Nov 15, 2011 9:12 pm

Send report direct to printer without preview

Post by pdt1704 »

Hi,
I used Stimulsoft Report version 2013.2 and ASP.NET, How can I send report direct printer (my printer connect with IIS server and I used object PrintDocument that .NET Framework support).
Please help,
Thanks.
User avatar
tpontow
Posts: 206
Joined: Thu Sep 06, 2012 8:46 am
Location: Bonn, Germany

Re: Send report direct to printer without preview

Post by tpontow »

Try this in C# code

Code: Select all

StiReport report = .....; // Implement loading or creating the report or whatever it takes to get a report at runtime...

report.Print(showPrintDialog:false);
Thorsten Pontow

It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
pdt1704
Posts: 60
Joined: Tue Nov 15, 2011 9:12 pm

Re: Send report direct to printer without preview

Post by pdt1704 »

Thank for reply,
My printer connect to other PC (not IIS server) and share with IIS server. IIS server set this printer is default printer.
It working very well if I must be used function API named LogonUserA (impersonate context).
How can I send report direct to printer without impersonate?
Please help,
Thanks.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Send report direct to printer without preview

Post by Alex K. »

Hello,

Please check the following topic in our knowledgebase:
http://support.stimulsoft.com/index.php ... a-web-page

Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Send report direct to printer without preview

Post by HighAley »

Hello.

Please, read next Printing a report with specified parameters article from our Knowledge Base.

Thank you.
pdt1704
Posts: 60
Joined: Tue Nov 15, 2011 9:12 pm

Re: Send report direct to printer without preview

Post by pdt1704 »

Aleksey wrote:Hello,

Please check the following topic in our knowledgebase:
http://support.stimulsoft.com/index.php ... a-web-page

Thank you.
Thanks for reply,
It run OK, but I see that it's was print as image?

Thanks.
pdt1704
Posts: 60
Joined: Tue Nov 15, 2011 9:12 pm

Re: Send report direct to printer without preview

Post by pdt1704 »

Aleksey Andreyanov wrote:Hello.

Please, read next Printing a report with specified parameters article from our Knowledge Base.

Thank you.
Thanks for reply,
I see error: Settings to access printer '\\My IP\my printer' are not valid. If I used Impersonate, it run OK.
When I used print with Impersonate, printing report using GDI and GDI technologies?
When I used print with Impersonate, quality print increment many times with image?
Please help,
Thanks.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Send report direct to printer without preview

Post by HighAley »

Hello.

Sorry, but it's not enough information to give you an answer.
Could you describe your issue more detailed with examples?
What do you mean under "Impersonate"?

Thank you.
pdt1704
Posts: 60
Joined: Tue Nov 15, 2011 9:12 pm

Re: Send report direct to printer without preview

Post by pdt1704 »

Thanks for reply,
My printer connect to other PC (not IIS server) and share printer with IIS server. IIS server set this printer is default printer.
I must be used function API named LogonUserA to login to IIS Server with user and pass,

Code: Select all

Declare Function LogonUserA Lib "advapi32.dll" (ByVal lpszUsername As String, _
                                                    ByVal lpszDomain As String, _
                                                    ByVal lpszPassword As String, _
                                                    ByVal dwLogonType As Integer, _
                                                    ByVal dwLogonProvider As Integer, _
                                                    ByRef phToken As IntPtr) As Integer

    Declare Auto Function DuplicateToken Lib "advapi32.dll" ( _
                                                             ByVal existingTokenHandle As IntPtr, _
                                                             ByVal impersonationLevel As Integer, _
                                                             ByRef duplicateTokenHandle As IntPtr) As Integer
after login ok, I can used all resource of IIS server, ex: printer, hdd shared for IIs server with user and pass that I login.
Please help.
Thanks.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Send report direct to printer without preview

Post by HighAley »

Hello.

But what problem do you have with our product?
You didn't mention it in your last message.
We can't suggest you how to get access to your printer.

Thank you.
Post Reply