Avatar billede nyholm Novice
28. november 2007 - 09:57 Der er 25 kommentarer og
1 løsning

Skapa PDF av Rapport

Jag anvænder Lebans løsning før att konvertera rapporter till PDF.
På min pc har jag Acrobat Professional och skulle dærfør inte behøva Lebans løsning. Den db som jag gjort anvænds också av andra och jag har lagt in Lebans løsning før att det skall vara møjligt att skapa PDF utan att ha Acrobat installerad.
Jag får det inte att fungera på dator som bara har Acrobat Reader installerad.
Jag har nu testat Lebans exempeldb med A2000SnapshotToPDF ver 751 på dator utan Acrobat och funktionen fungerar inte.
Jag får felmeddelande: Det format du førsøker exportera det aktuella objektet till ær inte tillgængligt.
Ær inte hela meningen med løsningen att jag inte skall behøva ha Acrobat installerad?
Tacksam før hjælp!
Avatar billede terry Ekspert
28. november 2007 - 10:57 #1
do you have a link to Lebans løsning so I can see what it consists of?
Avatar billede nyholm Novice
28. november 2007 - 11:19 #2
Avatar billede nyholm Novice
28. november 2007 - 11:24 #3
The error msg I get is: The format You are trying to export the object to is not available.
Avatar billede nyholm Novice
28. november 2007 - 11:38 #4
I might ad that both the dll files are in the same location as the db.
I have Vista Business and Office 2007 on one pc and there it works when I'm running the db in Access 2007, but not when I'm running it in Access2003 runtime mod.
I have one pc with XP and Office 2003 and  there it works both when I'm running the db in runtime and full mode.
A third pc has Vista and Access 2003 and there it does'nt work.
The first and the second pc has Acrobat Professional but not the third.
Avatar billede terry Ekspert
28. november 2007 - 12:07 #5
Can you give me a link to Lebans homepage where I can read about the snapshot to PDF converter? I'm interested in read the requirements etc.

Normally you need a program which can create a PDF document and as far as I know Acrobat reader cant. I think Acrobat Proffesional includes somethink called Distiller which creates the PDF documents. So if Lebans converter doesnt include a PDF creater than I think you will need to use Acrobat Prof.
Avatar billede nyholm Novice
28. november 2007 - 13:13 #6
Her is the link:
http://www.lebans.com/reporttopdf.htm
Where You find the following info:

"You can use the A2Kversion with A2000, A2002 and A2003.  It can also be converted to A97. Please view the form named README before launching the converter.

A2000ReportToPDF is an Access 2000 database containing a function to convert Reports and Snapshot files to PDF documents. No PDF Printer driver is required. This archive contains a new version of the DynaPDF library and the StrStorage library. Please make sure you delete your old version, especially if you copied them into your Windows\System folder."

What is the point with the Lebans solotion if Acrobat Prof. is still needed?

What I can't figur out is why, as mentioned earlier, it works on my first pc botht as runtime and full mode, but on the second it only works when running Access 2007 but not in Access 2003 runtime.
Avatar billede terry Ekspert
28. november 2007 - 14:52 #7
soory I've been busy and now I'm off home. I'll take a look later.
Avatar billede terry Ekspert
28. november 2007 - 19:01 #8
"What is the point with the Lebans solotion if Acrobat Prof. is still needed"

As far as I can see the solution doesnt need any version of Acrobat.

I've tested on a PC with Access 2003 on a 2003 Server an dit works OK.

The error you get
"Det format du førsøker exportera det aktuella objektet till ær inte tillgængligt."

Maybe you should first try creating a a snapshot file. If you cant then thats the problem because it uses it to convert.
Avatar billede nyholm Novice
28. november 2007 - 19:51 #9
I have found out that it has something to do with the installation package I'm creating. The developer extention I have for Access 2003 does something during the packaging. If I install my db on a clean pc together with the runtime for Access 2003, it does'nt work. If I then install another version of Access 2003 runtime and directly uninstall it, the Lebans solution works. Strange???
Avatar billede terry Ekspert
28. november 2007 - 20:08 #10
But can you print a snapshot report from your installation package?

I'm guessin that ist because the components for printing snapshot files isnt included in your installation package.
Avatar billede nyholm Novice
29. november 2007 - 09:00 #11
Yes I can, so it has to do with some other part of my runtime that is updated when I'm installing the second version. When I'm uninstalling it, it leaves the updated file since it is used by another program, i.e. my runtime. I could easiely leave my runtime and include the one that works, but it has the English language and I want to keep it Swedish.
A solution is to use the Access 2007 runtime, but Access 2007 db engine does not work as good as 2003.
Avatar billede terry Ekspert
29. november 2007 - 09:16 #12
Cant you alter your runtime setup to install what is needed?
Avatar billede terry Ekspert
29. november 2007 - 09:20 #13
http://office.microsoft.com/en-us/access/HP052612151033.aspx

You can download the viewer and include it in your setup kit maybe
Avatar billede terry Ekspert
29. november 2007 - 09:21 #14
Thinking about it though, maybe the viewer isnt enough. Ít needs to be able to create a snapshot file not just view it.
Avatar billede terry Ekspert
29. november 2007 - 09:30 #15
Can you do this for me?
On any PC which has full version of Access 2003 make a simple dB which can print a snapshot file using something like this.

    DoCmd.OutputTo acOutputReport, "NameOfREportGoesHere", "SnapshotFormat(*.snp)", "C:\test.snp"



Copy this on to the PC where PDF converter doesnt work. See if you can print the snapshot report.
Avatar billede nyholm Novice
30. november 2007 - 10:18 #16
I was away during yesterday but now I have done the test. The result is the same. I get the same error msg.
What puzzels me is that I had the function in my db to E-mail a report as snapshot and this works. Why does'nt Your test and Lebans solution work?
The reason why I want to be able to create PDF within my db is to be able to mail reports from it. To mail snapshots works if the reciever has Snapshot Viewer, so I would prefere sending PDF. Lebans solution is exelent if I can make it work and even better if the report is E-mailed as PDF in the same automated way as snapshot.
That would be worth another 100 points.
Avatar billede Slettet bruger
30. november 2007 - 14:26 #17
Hvorfor ikke den simple måde?
Installér PDF995 eller CutePDF - det kan hentes gratis på nettet.
Udskriv rapporten til PDF-printeren
Avatar billede terry Ekspert
30. november 2007 - 18:39 #18
as schlamovitz mentiones you could use something like CutePDF but I'm not at all sure if it saves a PDF document so you can mail it.
Avatar billede nyholm Novice
30. november 2007 - 19:19 #19
CutePDF is ok, but the optimal is to be able to, by automation, send the report as PDF and as an attatchment to an e-mail. Just as if the the user of my db had Acrobat Prof.
Avatar billede terry Ekspert
30. november 2007 - 19:28 #20
Just found this on the web (in German) It actually refres to Lebans PDF converter, so I think we may have found the problem. (Hope so)

Korrektur bei snp-konvertierung docmd.outputto
Wer das sehr gute Tool ConvertReportToPDF von Stefan Lebans in Access nutzt, um automatisch pdfs zu erzeugen,
dem kann es passieren, dass manchmal der Code an einigen Rechnern einen Fehler erzeugt.
Die Ursache liegt darin, dass der Ausgabeparameter nicht auf allen Rechnern eindeutig initialisiert ist.
Ich hab deshalb die Routine einfach doppelt laufen lassen, nach dem Prinzip, wenn nicht eins, dann nimm zwei.

Hier die Korrektur im Modul:
    ' Export the selected Report to SnapShot format
    'Optimierung Raimund: format anpassen
    On Error Resume Next
    DoCmd.OutputTo acOutputReport, RptName, 'Snapshot-Format (*.snp)', strPathandFileName
    'Optimierung Raimund..wieder regulärer verlauf
    If Err.Number = 2282 Then
        ''SnapshotFormat(*.snp)'
        On Error GoTo ERR_CREATSNAP
        DoCmd.OutputTo acOutputReport, RptName, 'SnapshotFormat(*.snp)', strPathandFileName
    End If
    On Error GoTo ERR_CREATSNAP
Avatar billede terry Ekspert
30. november 2007 - 19:30 #21
So you need to find the line of code which does the export

(DoCmd.OutputTo acOutputReport, RptName, 'Snapshot-Format (*.snp)', strPathandFileName)

and replace it with the code in my previous comment
Avatar billede nyholm Novice
02. december 2007 - 13:11 #22
Lebans solution has 3 different functions, make snapshot from a report, make PDF from a report and last, make PDF from a snapshot.
The German thing has to do with making snapshot from a report. As I understand, when making PDF from a report it first creates a snapshot and then converts it to a PDF.

As I have said earlier I had the function to E-mail a report as snapshot using the following command:
DoCmd.SendObject acReport, stDocName, "Snapshot Format",,,,"Attatchment file name"
and there is no problem in creating this snapshot to send.
That is why I can't figur out why Lebans solution does'nt work when it is included in the runtime version of Access 2003, when send as E-mail does?
The reason I want to send reports as PDF instead of snapshot is that it is mutch simplier for the reciever since allmost evryone has Acrobat Reader.
Avatar billede terry Ekspert
03. december 2007 - 17:46 #23
Have you tried replacing the code in Lebans modul with the code 30/11-2007 19:28:53 ?
Avatar billede terry Ekspert
03. december 2007 - 17:50 #24
I have no idea why it deosnt work but I can see that there is a problem in how the report type is given.

In the code 30/11-2007 19:28:53 it takes into acount two ways of giving it but you use a third. ("Snapshot Format") So you should maybe try this way in Lebans code.
Avatar billede nyholm Novice
04. december 2007 - 15:26 #25
Hi Terry!
To busy with everything, but now I tryed Your suggestion.
How blind one can be! Now it works. I had the solution myselve but could'nt see it.
Thank You, well wort the points.
Avatar billede terry Ekspert
04. december 2007 - 17:38 #26
Better place an answer then :o)

Great to hear its working.
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester