Printing without Preview Problem?!

Сonversation on different topics
Post Reply
senatormas
Posts: 3
Joined: Thu Jul 01, 2010 7:08 am

Printing without Preview Problem?!

Post by senatormas »

Hi
I have a report that I wanna be printed without being shown.
I have a problem with this issue.
I have dragged stireport to my form in below section so I have necessary Defining and parameters in my designer.vb form
Then I right click on my report (stireport) and entered in the designer section and I completed my designing there and save it.
So I have my report in my resources of my software.
Now I wanna use it through my source code.
First I filled my dataset and datatables in it.
Then I compiled my Report and set dynamic variables in it.
Now I wanna print it without showing the preview form.
The first print only have my variables which are not in the data section.
Actually I DON’T HAVE MY DATA IN FIRST PRINT!!!
But Second and third print have data and is doing fine.
When I close the form and open it again the problem is coming back!
WHY?!
If I show the preview form this problem is resolved but I don’t want to do that.
What’s happening through show and Print ?
What should I do before printing in order to have data in first print?
I even used Regdata and load from external file but it didn't resolve my problem!!!
Please help me
I'm using VB2010.net (3.5)
Best regards
Senamas
Andrew
Posts: 4107
Joined: Fri Jun 09, 2006 3:58 am

Printing without Preview Problem?!

Post by Andrew »

Hello,

Could you, please send us the code you use to support@stimulsoft.com.

Thank you.
senatormas
Posts: 3
Joined: Thu Jul 01, 2010 7:08 am

Printing without Preview Problem?!

Post by senatormas »

Andrew wrote:Hello,

Could you, please send us the code you use to support@stimulsoft.com.

Thank you.
'//////////////// in the Designer /////////////////// Private WithEvents Factor As Stimulsoft.Report.StiReport
'/////////////// in Code View ////////////////////////////////////////////////////////////////////////////////////////////////
CusSer = Me.NessTable_ServiceTableAdapter.RecentlyAdded(Me.TAXIDODataSet.NessTable_Service)
Stimulsoft.Report.StiOptions.Viewer.RightToLeft = Stimulsoft.Report.StiRightToLeftType.Yes
Stimulsoft.Report.StiOptions.Viewer.Windows.ShowOpenButton = False
Stimulsoft.Report.StiOptions.Viewer.Windows.ShowPageNewButton = False
Stimulsoft.Report.StiOptions.Viewer.Windows.ShowPageDeleteButton = False
Stimulsoft.Report.StiOptions.Viewer.Windows.ShowPageDesignButton = False
updatepd() '// just renew Persian Date which is not supported by windows and we should renew it manually
Factor.Compile()
Factor("tarix") = pd.ToString("d")
Factor("title") = ShopName
Factor("subtitle") = Payam_Undertitle
Factor("user") = strUserID
Factor("firstline") = SpecialPayam1
Factor("secondline") = SpecialPayam2
Factor.Render(False)

If defaultFactorPrinter "" Then
Dim PrinterSet As New System.Drawing.Printing.PrinterSettings
PrinterSet.PrinterName = defaultFactorPrinter
Factor.Print(False, PrinterSet)
Else '// Otherwise show the Print DBox
Factor.Print()
End If

If I put Factor.Show() before Factor.Print() the problem is resolved but I don't want to show the preview form!!!
And if I Print just like the above Code First Print Doesn't have any data but Second and third ...
Thank you for your attention
This link shows my problem:
http://www.4shared.com/document/Jk_ONVo1/Prints.html
68KB - PDF - 3PAGES
Attachments
475.Prints.pdf
(67.52 KiB) Downloaded 264 times
senatormas
Posts: 3
Joined: Thu Jul 01, 2010 7:08 am

Printing without Preview Problem?!

Post by senatormas »

I don't know What's Going on Here!!!
My Problem get resolved in a ridiculous way!!!
in First Print there should be no Render in my code and I will have no print in second and third
in Second And third I should have Render Before print!!!
in a result I should Have counter for my print!!!
when it is 0 it will jump the render and for bigger than 0 I have rendering for my report printing.
PLZ GIVE ME A LOGIC SOLUTION FOR THIS PROBLEM!!!
I don't like the miracle way!!!

Factor.Compile()
Factor("tarix") = pd.ToString("d")
Factor("title") = ShopName
Factor("subtitle") = Payam_Undertitle
Factor("user") = strUserID
Factor("firstline") = SpecialPayam1
Factor("secondline") = SpecialPayam2
If PrintCounter > 0 Then
Factor.Render(False)
End If
If defaultFactorPrinter "" Then
Dim PrinterSet As New System.Drawing.Printing.PrinterSettings
PrinterSet.PrinterName = defaultFactorPrinter
Factor.Print(False, PrinterSet)
PrintCounter += 1
Else
Factor.Print()
PrintCounter += 1
End If


Thank you!!!
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Printing without Preview Problem?!

Post by Jan »

Hello,

Sorry we can't reproduce this problem with help of provided information. It can have many reasons why it not work. Please send to support sample project which reproduce this problem.

Thank you.
Post Reply