[Gambas-user] gb.report2 save to pdf

Gianluigi bagonergi at gmail.com
Mon Feb 5 17:22:29 CET 2018


As mentioned, it seems not possible to do it in any other way than
graphically from the preview window.

Regards
Gianluigi

2018-02-05 17:15 GMT+01:00 Johny Provoost <johny.provoost at skynet.be>:

> OK, thanks
>
> I'll do it like this.
>
>
>
> Op 05-02-18 om 16:54 schreef Gianluigi:
>
>> It seems we can not print directly in the correct way, see here [0],
>> otherwise you could obtain it like this:
>>
>> Public Sub SavePDF()
>>
>> Â  Dim sPath As String
>> Â  Dim hReport1 As New Report1
>> Â  Dim hPrinter As New Printer
>>
>> Â  sPath = "/tmp/test.pdf" '<===============
>> Â  hPrinter.Orientation = hPrinter.Portrait
>> Â  hPrinter.Resolution = 150
>> Â  hPrinter.Paper = hPrinter.A4
>> Â  hPrinter.OutputFile = sPath
>> Â  hReport1.Print(hPrinter)
>> Â  ' Print "Report is saved"
>> Â  Balloon.Info("Report is saved", FMain)
>>
>> End
>>
>> Regards
>> Gianluigi
>>
>> [0] https://lists.gambas-basic.org/cgi-bin/search.cgi?q=Set+name
>> +in+gb.report+preview
>>
>>
>> 2018-02-05 16:31 GMT+01:00 Johny Provoost <johny.provoost at skynet.be
>> <mailto:johny.provoost at skynet.be>>:
>>
>>     Hallo,
>>
>>     In gb.report2 I want to change the name and path when I save the
>>     file as pdf through a variable, but I can't seem to find out how
>>     or if it's possible.
>>
>>     Can someone please show me the way?
>>
>>     Thanks,
>>
>>     Johny
>>
>>     --------------------------------------------------
>>
>>     This is the Gambas Mailing List:
>>     https://lists.gambas-basic.org/listinfo/user
>>     <https://lists.gambas-basic.org/listinfo/user>
>>
>>     Search the list:
>>     https://lists.gambas-basic.org/cgi-bin/search.cgi
>>     <https://lists.gambas-basic.org/cgi-bin/search.cgi>
>>
>>     Hosted by https://www.hostsharing.net
>>
>>
>>
>>
>> --------------------------------------------------
>>
>> This is the Gambas Mailing List:
>> https://lists.gambas-basic.org/listinfo/user
>>
>> Search the list:
>> https://lists.gambas-basic.org/cgi-bin/search.cgi
>>
>> Hosted by https://www.hostsharing.net
>>
>
> --
>
> ------------------------------------------------------------------------
>
> *Vriendelijke Groeten*
>
> *Johny Provoost*
>
> *mailto: **johny.provoost at skynet.be* <mailto:johny.provoost at skynet.be>
>
> *mailto: **johny.provoost at gmail.com* <mailto:johny.provoost at gmail.com>
>
> *Website:*http://www.jepe.be <http://www.jepe.be/>or
> http://www.johnyprovoost.net <http://www.johnyprovoost.net/>
>
>
> --------------------------------------------------
>
> This is the Gambas Mailing List:
> https://lists.gambas-basic.org/listinfo/user
>
> Search the list:
> https://lists.gambas-basic.org/cgi-bin/search.cgi
>
> Hosted by https://www.hostsharing.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20180205/2e6e0591/attachment-0001.html>


More information about the User mailing list