Save as HTML... change file names

… I have a report that I save as html each month. The report is in sections by client and each section gets sent separately as a html file to each client.

But… when I do a save as html ‘section by section’ the separate section files all get saved as numbered files and I have to go into each one, see what it is, and rename it by the client name.

Is there some way to get it to use the section names as the html file names?? There are about 50 files that have to be manually re-named every month…

Thanks!


cmhoz (BOB member since 2007-06-05)

hi,

I’m not sure if what you’re asking can be done.

Why don’t you automate the process using VB macro?
After refreshing the report, have the macro run a filter on the client section, save the filtered result as a html file using the object client name to be used as the name of the file. There’s some fine examples in the SDK section of this forum.

This topic contains a nice example using pdf format.


Bazzer :netherlands: (BOB member since 2005-10-18)

The link you sent me to looks like it will do exactly what I need - BUT, I’m getting stuck.

I was getting an error when I told the code what my section variable was - I think because it’s got odd symbols in it? Variable is: Alliance Code (Current). So, I used the “get variable name that the section is created on” code found further down the post to give the variable a simple name and use that… works beautifully UNTIL… I go to build the complex filter.

Heres what the sample code says:

myrpt.AddComplexFilter myFilterVar, "=<[b]State[/b]> = " &amp; """" &amp; strNextValue &amp; """"

I need to replace <State> with strSectionMaster. I’ve tried every thing i can think of, but I’m obviously getting the quotes screwed up somewhere - this is the last thing I tried to no avail:

myrpt.AddComplexFilter myFilterVar, "=" &amp; strSectionMaster &amp; "=" &amp; strNextValue

cmhoz (BOB member since 2007-06-05)

Solved the problem by creating a new variable: Alliances=<Alliance Code (Current)

Now the variable name is simple and the original code works perfectly.

cheers :slight_smile:


cmhoz (BOB member since 2007-06-05)