By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,142 Members | 910 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,142 IT Pros & Developers. It's quick & easy.

Lebans ConvertReportToPDF - Preview Form?

P: n/a
Does anyone know if Stephen Leban's ConvertReportToPDF for converting
mdb reports to pdf can be done for a print preview of a form?

A major Access application I've developed and use displays an MS Graph
control on a form. It's dynamic and I'd like my users to be able to
print their result to a pdf. I'm able to do so, but I have Acrobat
Professional on my own machine.

When I run the VBA line:

blRet = ConvertReportToPDF(strRptName, vbNullString, _
strRptName & ".pdf", True, True, 0, "", "", 0, 0)

I'd like to be able to have strRptName refer to a form preview.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
May 22 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Tim just create a report containing your MSGraph control. Set up the report
to resemble your form. At runtime simply adjust the Record Source of the
report to match the current view of the form. Open the Report in hidden
mode so as to not confuse the user.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Tim Marshall" <TI****@PurplePandaChasers.Moertheriumwrote in message
news:f2**********@coranto.ucs.mun.ca...
Does anyone know if Stephen Leban's ConvertReportToPDF for converting mdb
reports to pdf can be done for a print preview of a form?

A major Access application I've developed and use displays an MS Graph
control on a form. It's dynamic and I'd like my users to be able to print
their result to a pdf. I'm able to do so, but I have Acrobat Professional
on my own machine.

When I run the VBA line:

blRet = ConvertReportToPDF(strRptName, vbNullString, _
strRptName & ".pdf", True, True, 0, "", "", 0, 0)

I'd like to be able to have strRptName refer to a form preview.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me

May 22 '07 #2

P: n/a
Stephen Lebans wrote:
Tim just create a report containing your MSGraph control. Set up the report
to resemble your form. At runtime simply adjust the Record Source of the
report to match the current view of the form. Open the Report in hidden
mode so as to not confuse the user.
Stephen, I've never been able to do this. The MSGraph control is
dynamic and the form has loads of user definition options (which don't
display on a print of course) allowing the user to change the graph
type, where it's centred and so on. I've had numerous requirements in
the past with this application to be able to transfer how a user
actually manipulates his graph into a report and gave up, staying with
the form preview...

If anyone can think of a way to take a graph object from a form and
transfer it exactly onto a report, that would do the trick, but I've
never been able to figure out how to enumerate all the graphs properties...

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
May 22 '07 #3

P: n/a
Tim I have only worked with the MSGraph object a few times.
Have you tried exporting the Chart to diska nd then set the Picture property
of an Image control on your form to this temp file?

You could do this via the Clipboard and avoid the temp disk file. The older
OLE extraction solution on my site shows you how to do this for the contents
of an OLE Frame control.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Tim Marshall" <TI****@PurplePandaChasers.Moertheriumwrote in message
news:f2**********@coranto.ucs.mun.ca...
Stephen Lebans wrote:
>Tim just create a report containing your MSGraph control. Set up the
report to resemble your form. At runtime simply adjust the Record Source
of the report to match the current view of the form. Open the Report in
hidden mode so as to not confuse the user.

Stephen, I've never been able to do this. The MSGraph control is dynamic
and the form has loads of user definition options (which don't display on
a print of course) allowing the user to change the graph type, where it's
centred and so on. I've had numerous requirements in the past with this
application to be able to transfer how a user actually manipulates his
graph into a report and gave up, staying with the form preview...

If anyone can think of a way to take a graph object from a form and
transfer it exactly onto a report, that would do the trick, but I've never
been able to figure out how to enumerate all the graphs properties...

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me

May 22 '07 #4

P: n/a
Stephen Lebans wrote:
Tim I have only worked with the MSGraph object a few times.
Have you tried exporting the Chart to diska nd then set the Picture property
of an Image control on your form to this temp file?

You could do this via the Clipboard and avoid the temp disk file. The older
OLE extraction solution on my site shows you how to do this for the contents
of an OLE Frame control.
I took a quick look at your page http://www.lebans.com/oletodisk.htm.
But your last paragraph above intrigues me. I already have a button on
my form which uses the following VBA command, which is, I believe, from
the MS Chart 11 object library:

Me.ctlGraph.ChartArea.Copy

Which copies the chartarea of the graph object to clipboard. I use this
to paste graphs into MS Word or powerpoint, etc. Are you suggesting I
might be able to use the clipboard to bring the clipboard contents (in
this case, a chart area) into a report (you actually said "form" above
in your first paragraph, so I'm being optimistic) control?

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
May 22 '07 #5

P: n/a
Yes, at the bottom of that Web page is the older Clipboard based solution.
Once you ask your control to copy its contents to the Clipboard my solution
simply copies the current contents of the Clipboard to a disk based BMP file
which you could then load into the Picture property of the standard Image
control on your form or report.
If you wish, you could then bypass the temp disk file by converting the
memory DIB in the Clipboard to a CF_DIB(Clipbard object type) which is
basically the contents of an Image control's PictureData property which you
can set directly at runtime. There's code to do this in a couple of projects
on my site.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Tim Marshall" <TI****@PurplePandaChasers.Moertheriumwrote in message
news:f2**********@coranto.ucs.mun.ca...
Stephen Lebans wrote:
>Tim I have only worked with the MSGraph object a few times.
Have you tried exporting the Chart to diska nd then set the Picture
property of an Image control on your form to this temp file?

You could do this via the Clipboard and avoid the temp disk file. The
older OLE extraction solution on my site shows you how to do this for the
contents of an OLE Frame control.

I took a quick look at your page http://www.lebans.com/oletodisk.htm. But
your last paragraph above intrigues me. I already have a button on my
form which uses the following VBA command, which is, I believe, from the
MS Chart 11 object library:

Me.ctlGraph.ChartArea.Copy

Which copies the chartarea of the graph object to clipboard. I use this
to paste graphs into MS Word or powerpoint, etc. Are you suggesting I
might be able to use the clipboard to bring the clipboard contents (in
this case, a chart area) into a report (you actually said "form" above in
your first paragraph, so I'm being optimistic) control?

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me

May 22 '07 #6

P: n/a
Stephen Lebans wrote:
Yes, at the bottom of that Web page is the older Clipboard based solution.
Once you ask your control to copy its contents to the Clipboard my solution
simply copies the current contents of the Clipboard to a disk based BMP file
which you could then load into the Picture property of the standard Image
control on your form or report.
If you wish, you could then bypass the temp disk file by converting the
memory DIB in the Clipboard to a CF_DIB(Clipbard object type) which is
basically the contents of an Image control's PictureData property which you
can set directly at runtime. There's code to do this in a couple of projects
on my site.
Wow, this has serious possibilities for me. I've always had some
limitations with my otherwise excellent user customization graphing
solution displayed on form. It would be nice indeed to have this able
to be set to a report instead of a printed form. My app involves text
reports and graphing. Another thing I've been unable to do is combine
the user customized graph with a report.

Great stuff, thanks very much for your help.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
May 23 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.