If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
saving report
I have a report with 600 pages...each page for a different client. Is
there a way to have Access automatically save each page as a separate report? I would want each page saved using the client name field. -- Message posted via http://www.accessmonster.com |
#2
|
|||
|
|||
saving report
"dhoover via AccessMonster.com" u26355@uwe wrote
I have a report with 600 pages...each page for a different client. Is there a way to have Access automatically save each page as a separate report? I would want each page saved using the client name field. I don't understand what you mean by "save each page as a separate report." You can certainly use the Page Header / Page Footer to label the page with the client's name, and, instead of using the built-in Page and/or Pages variables, just set "Page 1 of 1" (or nothing at all for that matter) as the page number. Then, of course, when printed, you would have a stack of 600 "one page reports". But somehow I doubt that is what you want. Please clarify and likely someone will have a response. Larry Linson Microsoft Access MVP |
#3
|
|||
|
|||
saving report
I have 600+ pages of a report, each for one client. When I export the report,
I need to save each page as clientname.rtf, so if page 1 is client A and page two is client B and page 3 is client C, then page one needs to be named ClientA.rtf and page 2 as ClientB.rtf and so on. Larry Linson wrote: I have a report with 600 pages...each page for a different client. Is there a way to have Access automatically save each page as a separate report? I would want each page saved using the client name field. I don't understand what you mean by "save each page as a separate report." You can certainly use the Page Header / Page Footer to label the page with the client's name, and, instead of using the built-in Page and/or Pages variables, just set "Page 1 of 1" (or nothing at all for that matter) as the page number. Then, of course, when printed, you would have a stack of 600 "one page reports". But somehow I doubt that is what you want. Please clarify and likely someone will have a response. Larry Linson Microsoft Access MVP -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...ports/200708/1 |
#4
|
|||
|
|||
saving report
"dhoover via AccessMonster.com" u26355@uwe wrote
I have 600+ pages of a report, each for one client. When I export the report, I need to save each page as clientname.rtf, so if page 1 is client A and page two is client B and page 3 is client C, then page one needs to be named ClientA.rtf and page 2 as ClientB.rtf and so on. There is no "Save Each Page as a Separate Report" option in Access' reporting feature. Further, I've never been very pleased with the fidelity of .RTF report output to the format of the Report as I view it on the screen. You could run 600 separate reports, using the DoCmd.OpenReport with a WhereCondition that identifies the client, but I also doubt that a 600-pass loop is what you had in mind. Still, it may be the best and simplest approach to obtain the output you want. Another approach is that you write VBA code to post-process the 600-page output file to produce 600 one-page files. As I am not familiar with .RTF markup, I can't guess how effective that would be. From my perspective, it would be simpler to handle if you saved the output as XML or HTML format, because those are text files, and relatively easy to read and write, and I think the markup is more straightforward and intuitive. This, would require some additional coding work, but isn't "rocket science." Larry Linson Microsoft Access MVP |
#5
|
|||
|
|||
saving report
I've been working on the code, but haven't had much luck. I'm able to loop
through and export as htm, but it names all the reports the same even though I have it based on the client name. This is what I have so far (though this is using rtf format): Dim Db As DAO.Database Dim rst As Recordset Dim mycondition As String Set Db = CurrentDb Set rst = Db.OpenRecordset("Select Customer from [Customer Info]") While Not rst.EOF mycondition = [Customer] = " & rst![Customer]" DoCmd.OpenReport "Customer Instructions", , , mycondition DoCmd.OutputTo acOutputReport, [Customer], acFormatRTF, "c:\bbtdata\" & ". rtf", False rst.MoveNext Wend Larry Linson wrote: I have 600+ pages of a report, each for one client. When I export the report, I need to save each page as clientname.rtf, so if page 1 is client A and page two is client B and page 3 is client C, then page one needs to be named ClientA.rtf and page 2 as ClientB.rtf and so on. There is no "Save Each Page as a Separate Report" option in Access' reporting feature. Further, I've never been very pleased with the fidelity of .RTF report output to the format of the Report as I view it on the screen. You could run 600 separate reports, using the DoCmd.OpenReport with a WhereCondition that identifies the client, but I also doubt that a 600-pass loop is what you had in mind. Still, it may be the best and simplest approach to obtain the output you want. Another approach is that you write VBA code to post-process the 600-page output file to produce 600 one-page files. As I am not familiar with .RTF markup, I can't guess how effective that would be. From my perspective, it would be simpler to handle if you saved the output as XML or HTML format, because those are text files, and relatively easy to read and write, and I think the markup is more straightforward and intuitive. This, would require some additional coding work, but isn't "rocket science." Larry Linson Microsoft Access MVP -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...ports/200708/1 |
#6
|
|||
|
|||
saving report
This is the code I am using for html. I'm missing a piece but I'm not sure
what. I keeping getting the error that it can't find the field customer. On Error GoTo Err_Label Dim strReportName As String Dim strFileName As String Dim rst As Recordset Dim strcustomer As String Dim strFilepath As String Dim Db As DAO.Database Dim mycondition As String Dim strRecordsource As String Set rst = CurrentDb.OpenRecordset("Select Customer from [Customer Info]") While Not rst.EOF rst.MoveFirst strcustomer = [Customer] strFilepath = "C:\bbtdata\" strFileName = [Customer] & ".html" mycondition = strcustomer strReportName = "customer instructions" strRecordsource = "SELECT customer FROM [customer info]" DoCmd.OpenReport strReportName, acNormal Reports.Item(strReportName).RecordSource = strRecordsource DoCmd.Close acReport, strReportName, acSaveYes DoCmd.OutputTo acOutputReport, strReportName, acFormatHTML, strFilepath & "" & strFileName rst.MoveNext Exit_Label: On Error Resume Next rst.Close Set rst = Nothing Exit Sub Err_Label: MsgBox Err.Description Resume Exit_Label dhoover wrote: I've been working on the code, but haven't had much luck. I'm able to loop through and export as htm, but it names all the reports the same even though I have it based on the client name. This is what I have so far (though this is using rtf format): Dim Db As DAO.Database Dim rst As Recordset Dim mycondition As String Set Db = CurrentDb Set rst = Db.OpenRecordset("Select Customer from [Customer Info]") While Not rst.EOF mycondition = [Customer] = " & rst![Customer]" DoCmd.OpenReport "Customer Instructions", , , mycondition DoCmd.OutputTo acOutputReport, [Customer], acFormatRTF, "c:\bbtdata\" & ". rtf", False rst.MoveNext Wend I have 600+ pages of a report, each for one client. When I export the report, I need to save each page as clientname.rtf, [quoted text clipped - 22 lines] Larry Linson Microsoft Access MVP -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...ports/200708/1 |
Thread Tools | |
Display Modes | |
|
|