I need to Runexport from DB to specific file im my network, no problem.
When i search there is more than one post, so I get a list and export all searchhits, No problem.

BUT I need to name the pdf files to each specific invoice number.
Each post has a specific Invoice number.
Now the export only takes the post that I,m standing at.

When I export it set all document name to the same invoice number followed by _1, _2 .....



Recommended Answers

All 9 Replies

Am a little unclear of what is happening. Are you looping a dataset, and outputting each row into a PDF ?

Well no..
I think I must do that in order to focus each row.
The result must be the same as the posts result and not only the first followed by_1 etc...
I could use some help...

You will have to generate a correct filename (based on the invoice), but without more information on what is happening it will be difficult to guide you.

Well what is happening is that the files are named to the first post.
ea.1000 (the correct name).
Then the next is named 1000_1, 1000_2 and so on.
I need to have the name from each posts.
The correct should have been 1000, 1001, 1002 (with data from the posts).

Show the relevant sourcecode.

   oReport : object;   
   sSql, sFakturanr, sCond:string;
   iFaktnr : integer;

//sCond:='olh.foretagkod='+tosql(sy1.foretagkod)+' and olh.ftgnr='+tosql(olh.ftgnr);
//RunReport('rfaktful','faktura se',sCond,'');   //run a report with a certain template

  SqlBegin('select distinct faktnr from olh where faktnr='+tosql(olh.faktnr)+' and foretagkod='+tosql(sy1.foretagkod));
  if(SqlExecute) then begin
  while(SqlFetch) do begin

    oReport:=application.getreport('rfaktful' + '_' + sCond:='olh.faktnr='+tosql(olh.faktnr);

In RunExport, olh.faktnr is the same for all records (hence the _N postfixes on the filenames). Do you want to use a different column here?

olh is the table and faktnr is where the invoice number is.
So it has to be this column!?

would a loop solve this with going to next post and getting that value from faktnr!?

SqlFetch should do just this (assuming from it's name). However, I am unfamilar with this function, or the tool you are using.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.