Announcement

Collapse
No announcement yet.

Formatting variables for print

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Formatting variables for print

    Hi,
    I have a customer who wants a document to print in the same form as an existing paper version. It's actually the output of an assessment (test) & I have this coded with the info required stored in variables.
    I can easily store them into a file on disc & print the text file out but wondered if there is an easy way to format the text the way the customer wants it.
    The only idea I had was to create a blank HTML file in the right format & then copy that source info into the AMS box for what to store in the text file, which would be named as testres.htm. Then jump to the page with a browser showing the created htm file with a print button.
    Has anyone got an easier way?
    Tia
    Scally

  • #2
    Re: Formatting variables for print

    That sounds like a pretty solid approach to me...

    Corey Milner
    Creative Director, Indigo Rose Software

    Comment


    • #3
      Re: Formatting variables for print

      Cory,
      Thanks. That seemed to work OK.
      However, doing it brought up a couple of supplementaries:
      1. The html with the variables displays great on screen but its longer than a single page, so I'm getting a page break on printing. Is there any way to cause a page break so I'm sure I've got the page ending in an acceptable place & not in the middle of something?
      2. The page displays the footer (file ref). Any way to loose it?

      TIA
      Scally

      Comment


      • #4
        Re: Formatting variables for print

        I never use printers so I'm not sure. Must be some way though I would imagine.

        If a client requested that of me I'd likely handling it via a flash object (you mark your print frame with a '#p') because then it would be printing as vectors. I tend to stick to vectors (or 300 dpi raster) when a client asks me to do anything which needs to be printed. But to be honest every client I've ever worked with preferred optional pdfs (You can create pdfs on the fly with PHP) to anything else when it comes to printing.

        Corey Milner
        Creative Director, Indigo Rose Software

        Comment


        • #5
          Re: Formatting variables for print

          1. Page break: not sure if this would work, but...you could insert the ASCII code for a form feed (new page) into the file. It's ASCII character 12, or 0C in hexadecimal.

          2. Footer: that's probably defined in the page setup for the printer, something the user would probably have to change in their printer driver's settings themselves (unless you can change it temporarily with a command line utility or something).
          --[[ Indigo Rose Software Developer ]]

          Comment


          • #6
            Re: Formatting variables for print

            Thanks Lorne,
            1.I'll give it a try. It's not ideal though because the test is randomised, so I can only break the page with a margin of safety rather than where it should be. But it's better than half a question being printed on the form.
            2. I actually responded to this myself but Corey must have removed it when replying - There was a post I found about getting rid of headers & footers which extracted the info from the Reg, stored it in variables, set them to spaces & then restored on close.
            Thanks
            Scally

            Comment


            • #7
              Re: Formatting variables for print

              No that's incorrect. No one has been here removing any posts that I know of. Please do not assume that I am responsible for omitting posts which you may have misposted or forgot to post. I saw no reply in this thread from you after your last one, and I watch this forum very closely. Perhaps you meant to post, but you didn't actually... [img]/ubbthreads/images/icons/smile.gif[/img] I know that for a fact because I watched this thread all weekend...

              Corey Milner
              Creative Director, Indigo Rose Software

              Comment


              • #8
                Re: Formatting variables for print

                Scally, think you could dig up that info you found about headers and footers, and try to post it again?

                I'm sure other users could benefit from it.
                --[[ Indigo Rose Software Developer ]]

                Comment


                • #9
                  Re: Formatting variables for print

                  SCALLY

                  I think you can do page breaks in HTML using CSS. I never tried it but I read about it when looking for something else to do with CSS.

                  SCALLY & LORNE

                  Here is the code you need to remove the headers and Footers in IE as well as set the page margins. This is has been updated and improved over what I had previously posted (what SCALLY found in an old message)

                  Essentially on Project load you get the current IE header, footer, and margins from the registry and store those. Then you set all those things to your settings. If a user has never gone into the page in IE to set the print settings, these reg keys may not exist. This code takes this into account.

                  Then on Close or Destroy for the project the second set of actions will restore the users margins, header and footer info in IE.

                  PROJECT ON INTITIALIZE ACTIONS

                  <IR_ACTIONS_LIST>
                  <Action name="Comment">
                  <Type>202</Type>
                  <Function>2</Function>
                  <DTIndentLevel>0</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Comment>PREPARE IE FOR PRINTING</Comment>
                  </Action>
                  <Action name="Comment">
                  <Type>202</Type>
                  <Function>2</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Comment>Set Defaults Header, Footer, Margin Info</Comment>
                  </Action>
                  <Action name="Set Value">
                  <Type>6</Type>
                  <Function>0</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Variable>%Header%</Variable>
                  <Value>Default</Value>
                  <Evaluate>0</Evaluate>
                  </Action>
                  <Action name="Set Value">
                  <Type>6</Type>
                  <Function>0</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Variable>%Footer%</Variable>
                  <Value>Default</Value>
                  <Evaluate>0</Evaluate>
                  </Action>
                  <Action name="Set Value">
                  <Type>6</Type>
                  <Function>0</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Variable>%MarginTop%</Variable>
                  <Value>Default</Value>
                  <Evaluate>0</Evaluate>
                  </Action>
                  <Action name="Set Value">
                  <Type>6</Type>
                  <Function>0</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Variable>%MarginBottom%</Variable>
                  <Value>Default</Value>
                  <Evaluate>0</Evaluate>
                  </Action>
                  <Action name="Set Value">
                  <Type>6</Type>
                  <Function>0</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Variable>%Marginleft%</Variable>
                  <Value>Default</Value>
                  <Evaluate>0</Evaluate>
                  </Action>
                  <Action name="Set Value">
                  <Type>6</Type>
                  <Function>0</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Variable>%MarginRight%</Variable>
                  <Value>Default</Value>
                  <Evaluate>0</Evaluate>
                  </Action>
                  <Action name="Blank Line">
                  <Type>203</Type>
                  <Function>2</Function>
                  <DTIndentLevel>0</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  </Action>
                  <Action name="Comment">
                  <Type>202</Type>
                  <Function>2</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Comment>Get IE Header, Footer, Margin Info</Comment>
                  </Action>
                  <Action name="Get Value Data">
                  <Type>72</Type>
                  <Function>0</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Variable>%Header%</Variable>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <Value>header</Value>
                  <AutoExpand>0</AutoExpand>
                  </Action>
                  <Action name="Get Value Data">
                  <Type>72</Type>
                  <Function>0</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Variable>%Footer%</Variable>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <Value>footer</Value>
                  <AutoExpand>0</AutoExpand>
                  </Action>
                  <Action name="Get Value Data">
                  <Type>72</Type>
                  <Function>0</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Variable>%MarginTop%</Variable>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <Value>margin_top</Value>
                  <AutoExpand>0</AutoExpand>
                  </Action>
                  <Action name="Get Value Data">
                  <Type>72</Type>
                  <Function>0</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Variable>%MarginBottom%</Variable>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <Value>margin_bottom</Value>
                  <AutoExpand>0</AutoExpand>
                  </Action>
                  <Action name="Get Value Data">
                  <Type>72</Type>
                  <Function>0</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Variable>%MarginLeft%</Variable>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <Value>margin_left</Value>
                  <AutoExpand>0</AutoExpand>
                  </Action>
                  <Action name="Get Value Data">
                  <Type>72</Type>
                  <Function>0</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Variable>%MarginRight%</Variable>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <Value>margin_right</Value>
                  <AutoExpand>0</AutoExpand>
                  </Action>
                  <Action name="Blank Line">
                  <Type>203</Type>
                  <Function>2</Function>
                  <DTIndentLevel>0</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  </Action>
                  <Action name="Comment">
                  <Type>202</Type>
                  <Function>2</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Comment>Set or Delete IE Header Footer Info</Comment>
                  </Action>
                  <Action name="Set Value">
                  <Type>74</Type>
                  <Function>0</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <ValueName>header</ValueName>
                  <ValueData/>
                  <DataType>1</DataType>
                  </Action>
                  <Action name="Set Value">
                  <Type>74</Type>
                  <Function>0</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <ValueName>footer</ValueName>
                  <ValueData/>
                  <DataType>1</DataType>
                  </Action>
                  <Action name="Blank Line">
                  <Type>203</Type>
                  <Function>2</Function>
                  <DTIndentLevel>0</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  </Action>
                  <Action name="Comment">
                  <Type>202</Type>
                  <Function>2</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Comment>Set IE Margins</Comment>
                  </Action>
                  <Action name="Set Value">
                  <Type>74</Type>
                  <Function>0</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <ValueName>margin_top</ValueName>
                  <ValueData>0.50000</ValueData>
                  <DataType>1</DataType>
                  </Action>
                  <Action name="Set Value">
                  <Type>74</Type>
                  <Function>0</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <ValueName>margin_bottom</ValueName>
                  <ValueData>0.50000</ValueData>
                  <DataType>1</DataType>
                  </Action>
                  <Action name="Set Value">
                  <Type>74</Type>
                  <Function>0</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <ValueName>margin_left</ValueName>
                  <ValueData>0.50000</ValueData>
                  <DataType>1</DataType>
                  </Action>
                  <Action name="Set Value">
                  <Type>74</Type>
                  <Function>0</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <ValueName>margin_right</ValueName>
                  <ValueData>0.50000</ValueData>
                  <DataType>1</DataType>
                  </Action>
                  </IR_ACTIONS_LIST>







                  PROJECT ON DESTROY &amp; CLOSE ACTIONS

                  <IR_ACTIONS_LIST>
                  <Action name="Blank Line">
                  <Type>203</Type>
                  <Function>2</Function>
                  <DTIndentLevel>0</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  </Action>
                  <Action name="Comment">
                  <Type>202</Type>
                  <Function>2</Function>
                  <DTIndentLevel>0</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Comment>Replace Header Info</Comment>
                  </Action>
                  <Action name="IF">
                  <Type>200</Type>
                  <Function>1</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Condition>%Header% = "Default"</Condition>
                  </Action>
                  <Action name="Delete Value">
                  <Type>69</Type>
                  <Function>0</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <ValueName>header</ValueName>
                  </Action>
                  <Action name="END IF">
                  <Type>201</Type>
                  <Function>1</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  </Action>
                  <Action name="IF">
                  <Type>200</Type>
                  <Function>1</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Condition>%Header% != "Default"</Condition>
                  </Action>
                  <Action name="Set Value">
                  <Type>74</Type>
                  <Function>0</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <ValueName>header</ValueName>
                  <ValueData>%Header%</ValueData>
                  <DataType>1</DataType>
                  </Action>
                  <Action name="END IF">
                  <Type>201</Type>
                  <Function>1</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  </Action>
                  <Action name="Blank Line">
                  <Type>203</Type>
                  <Function>2</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  </Action>
                  <Action name="Comment">
                  <Type>202</Type>
                  <Function>2</Function>
                  <DTIndentLevel>0</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Comment>Replace Footer Info</Comment>
                  </Action>
                  <Action name="IF">
                  <Type>200</Type>
                  <Function>1</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Condition>%Footer% = "Default"</Condition>
                  </Action>
                  <Action name="Delete Value">
                  <Type>69</Type>
                  <Function>0</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <ValueName>footer</ValueName>
                  </Action>
                  <Action name="END IF">
                  <Type>201</Type>
                  <Function>1</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  </Action>
                  <Action name="IF">
                  <Type>200</Type>
                  <Function>1</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Condition>%Footer% != "Default"</Condition>
                  </Action>
                  <Action name="Set Value">
                  <Type>74</Type>
                  <Function>0</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <ValueName>footer</ValueName>
                  <ValueData>%Footer%</ValueData>
                  <DataType>1</DataType>
                  </Action>
                  <Action name="END IF">
                  <Type>201</Type>
                  <Function>1</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  </Action>
                  <Action name="Blank Line">
                  <Type>203</Type>
                  <Function>2</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  </Action>
                  <Action name="Comment">
                  <Type>202</Type>
                  <Function>2</Function>
                  <DTIndentLevel>0</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Comment>Replace Top Margin</Comment>
                  </Action>
                  <Action name="IF">
                  <Type>200</Type>
                  <Function>1</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Condition>%MarginTop% = "Default"</Condition>
                  </Action>
                  <Action name="Delete Value">
                  <Type>69</Type>
                  <Function>0</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <ValueName>margin_top</ValueName>
                  </Action>
                  <Action name="END IF">
                  <Type>201</Type>
                  <Function>1</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  </Action>
                  <Action name="IF">
                  <Type>200</Type>
                  <Function>1</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Condition>%MarginTop% != "Default"</Condition>
                  </Action>
                  <Action name="Set Value">
                  <Type>74</Type>
                  <Function>0</Function>
                  <DTIndentLevel>3</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <ValueName>margin_top</ValueName>
                  <ValueData>%MarginTop%</ValueData>
                  <DataType>1</DataType>
                  </Action>
                  <Action name="END IF">
                  <Type>201</Type>
                  <Function>1</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  </Action>
                  <Action name="Blank Line">
                  <Type>203</Type>
                  <Function>2</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  </Action>
                  <Action name="Comment">
                  <Type>202</Type>
                  <Function>2</Function>
                  <DTIndentLevel>0</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Comment>Replace Bottom Margin</Comment>
                  </Action>
                  <Action name="IF">
                  <Type>200</Type>
                  <Function>1</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Condition>%MarginBottom% = "Default"</Condition>
                  </Action>
                  <Action name="Delete Value">
                  <Type>69</Type>
                  <Function>0</Function>
                  <DTIndentLevel>3</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <ValueName>margin_bottom</ValueName>
                  </Action>
                  <Action name="END IF">
                  <Type>201</Type>
                  <Function>1</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  </Action>
                  <Action name="IF">
                  <Type>200</Type>
                  <Function>1</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Condition>%MarginBottom% != "Default"</Condition>
                  </Action>
                  <Action name="Set Value">
                  <Type>74</Type>
                  <Function>0</Function>
                  <DTIndentLevel>3</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <ValueName>margin_bottom</ValueName>
                  <ValueData>%MarginBottom%</ValueData>
                  <DataType>1</DataType>
                  </Action>
                  <Action name="END IF">
                  <Type>201</Type>
                  <Function>1</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  </Action>
                  <Action name="Blank Line">
                  <Type>203</Type>
                  <Function>2</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  </Action>
                  <Action name="Comment">
                  <Type>202</Type>
                  <Function>2</Function>
                  <DTIndentLevel>0</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Comment>Replace Left Margin</Comment>
                  </Action>
                  <Action name="IF">
                  <Type>200</Type>
                  <Function>1</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Condition>%MarginLeft% = "Default"</Condition>
                  </Action>
                  <Action name="Delete Value">
                  <Type>69</Type>
                  <Function>0</Function>
                  <DTIndentLevel>3</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <ValueName>margin_left</ValueName>
                  </Action>
                  <Action name="END IF">
                  <Type>201</Type>
                  <Function>1</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  </Action>
                  <Action name="IF">
                  <Type>200</Type>
                  <Function>1</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Condition>%MarginTop% != "Default"</Condition>
                  </Action>
                  <Action name="Set Value">
                  <Type>74</Type>
                  <Function>0</Function>
                  <DTIndentLevel>3</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <ValueName>margin_left</ValueName>
                  <ValueData>%MarginLeft%</ValueData>
                  <DataType>1</DataType>
                  </Action>
                  <Action name="END IF">
                  <Type>201</Type>
                  <Function>1</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  </Action>
                  <Action name="Blank Line">
                  <Type>203</Type>
                  <Function>2</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  </Action>
                  <Action name="Comment">
                  <Type>202</Type>
                  <Function>2</Function>
                  <DTIndentLevel>0</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Comment>Replace Right Margin</Comment>
                  </Action>
                  <Action name="IF">
                  <Type>200</Type>
                  <Function>1</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Condition>%MarginRight% = "Default"</Condition>
                  </Action>
                  <Action name="Delete Value">
                  <Type>69</Type>
                  <Function>0</Function>
                  <DTIndentLevel>3</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <ValueName>margin_right</ValueName>
                  </Action>
                  <Action name="END IF">
                  <Type>201</Type>
                  <Function>1</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  </Action>
                  <Action name="IF">
                  <Type>200</Type>
                  <Function>1</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Condition>%MarginRight% != "Default"</Condition>
                  </Action>
                  <Action name="Set Value">
                  <Type>74</Type>
                  <Function>0</Function>
                  <DTIndentLevel>3</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>0</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <MainKey>2</MainKey>
                  <SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
                  <ValueName>margin_Right</ValueName>
                  <ValueData>%MarginRight%</ValueData>
                  <DataType>1</DataType>
                  </Action>
                  <Action name="END IF">
                  <Type>201</Type>
                  <Function>1</Function>
                  <DTIndentLevel>2</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  </Action>
                  </IR_ACTIONS_LIST>

                  Comment


                  • #10
                    Re: Formatting variables for print

                    Thanks for the info!

                    Might I make a suggestion, though?

                    Instead of storing the current header/footer settings on project initialize, and restoring them on project close...I would recommend changing it immediately before/after any print operation.

                    So, instead of:

                    <font color=red>start project
                    store current settings
                    change settings
                    ...
                    ...
                    ...
                    print
                    ...
                    ...
                    ...
                    restore settings
                    exit project</font color=red>

                    You'd have:

                    <font color=green>start project
                    store current settings
                    ...
                    ...
                    ...
                    change settings
                    print
                    restore settings
                    ...
                    ...
                    ...
                    exit project</font color=green>

                    There are two reasons I recommend against doing it on project init and project close:

                    - if the user alt-tabs to IE and prints a web page, their expected header/footer settings won't be in effect

                    - which then gives the user opportunity to change the settings back on their own, which would mean that your header/footer settings wouldn't be in effect
                    --[[ Indigo Rose Software Developer ]]

                    Comment


                    • #11
                      Re: Formatting variables for print

                      Cory,
                      WOah there! No offence intended. However, the post I'm referring to was immediately after the one with two points &amp; said to ignore the second point on headers etc. cos I found the post. I guessed you'd removed it 'cos it wasn't relevant. I'll accept I didn't post it but it previewed OK!
                      Scally

                      Comment


                      • #12
                        Re: Formatting variables for print

                        Thanks guys,
                        Excellent stuff as always.
                        Scally

                        Comment


                        • #13
                          Re: Formatting variables for print

                          Good Idea Lorne and probably the right way to do this...

                          ...except it won't work in my AMS project. I'm loading a full screen CD based website that uses frames. I then use a form object Print button backed up with some javascript to initiate printing of just the one of the three frames.

                          Add to that a stylesheet that is used only for printing that hides the buttons and some text so that it does not print out.

                          I'm not actually using the AMS print function and unless I post some data to the URL on print and then have AMS parse the URL to determine that a print command was activated I don't think AMS could know when to make the substitutions.

                          Now if we had an on-print event within the Web object I could do that.... And at that point IR might as well have the margins and header editing be actions within AMS : )

                          Comment


                          • #14
                            Re: Formatting variables for print

                            Heh, in a sense it is the way you're doing it in your project...it's just that in your project, the "need to print" part begins right after project init, and ends right before project close.
                            [img]/ubbthreads/images/icons/smile.gif[/img]
                            --[[ Indigo Rose Software Developer ]]

                            Comment

                            Working...
                            X