Page Index Toggle Pages: [1] 2 3  Send Topic Send Topic Print Print
Very Hot Topic (More than 25 Replies) Printing Records and Subrecords with PrintString (Read 14784 times)
jondolar
Junior Member
**
Offline


Keep Trying

Posts: 57
Location: Montreal Canada
Joined: Dec 25th, 2003
Printing Records and Subrecords with PrintString
May 23rd, 2004 at 7:24pm
Print Post Print Post  
Hi

I'm using the tial version of Sesame and one of my biggest concern about Sesame is reporting.  I was delighted to download the PrintString program example. My joy was short lived. I'm incapable to oped the database or its DSR file. The message state that... The application PrintString was created with a trial version of Sesame and has expired. To activate the application, the full version of Sesame is available at.....etc.  My own trial version still has over 20 days of life. I can't imagine that a Lantician would use a Trial version of Sesame to produce that sample file Shocked.

Is it impossible to open it with a trial version ??? If so, then the message is all wrong. Also, this sample file could have convince me that Sesame is the right DBMS for me.  If I c'ant use the sample file, that won't help Cry

A disappointed potential user

Serge
  

When all you have is a hammer, everything starts to look like nail!
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Printing Records and Subrecords with PrintStri
Reply #1 - May 24th, 2004 at 10:32am
Print Post Print Post  
Jondolar,

The trial version itself never expires. The applications themselves expire and cannot be used by the trial version if they are more than 30 days old. In this case, the original sample application was built more than 30 days ago, so it will not work with the trial version.

If you want to try this yourself, you can place a command button on the Gem Types form in the the Gems sample app that came with the trial version. Place this code in the On Element Entry event for the command button.

Code
Select All
// This routine uses PrintString to create a formatted page including
// information from both the Main record and all of its subrecords.

var vDescription as string
var vPos as int
var vSub as int
var vSubTotal as int
var vPriceTotal as double
var vYCor as int
var vPrice as double
var vSPrice as string

//Create a new Page
NewPage(850,1100)

// Print header
PrintString("Lantica Jewelers", 300, 25, 0, "BArial", 30, 0)

// Format and print Gem_Type, Description and Occurence
vDescription = "The " + Gem_Type + " is " + Description + @NewLine() + "That is most commonly found in "
vDescription = Vdescription + Occurrence
PrintString(vDescription, 50, @PageExtentY() + 10, 725, "Arial", 15, 0)


//Format and print Birthstone and Hardness
vDescription = "It is the birthstone for the month of " + Birthstone_Month + "."
vDescription = vDescription + " It has a Hardness of " + Hardness
PrintString(vDescription, 50, @PageExtentY(), 725, "Arial", 15, 0)

// Print Appearance
PrintString(Appearance, 50, @PageExtentY(), 725, "Arial", 15, 0)

// Print Enhancements
PrintString(Enhancements , 50, @PageExtentY(), 725, "Arial", 15, 0)


// Format and print count of Subrecords.
vDescription = "We at Lantica Jewelers are lucky enough to have " + @FormResultSetTotal("Gems") + " of these rare jewels in stock"
PrintString(vDescription, 50, @PageExtentY() + 10, 725, "Arial", 15, 0)


// Prints Sub Header 1/10 of an inch below the general description of the gem
PrintString("Current Inventory of " + Gem_Type + @NewLine(), 255, @PageExtentY() + 20, 0, "Arial", 25, 0)


//Loops through the Subrecords
vSubTotal = @FormResultSetTotal("Gems")
vSub = 1
While vSub <= vSubTotal
{
	VDescription = @FormFieldValue("Gems", "Gem", vSub)
	vYCor = @PageExtentY() + 2				  // Y coordinate for the values
	FormResultSetCurrentPosition("Gems", vSub)
	PrintString(@FormFieldValue("Gems", "Gem", vSub), 50, vYCor, 90, "Arial", 15, 0)
	PrintString(@FormFieldValue("Gems", "Origin", vSub), @PageExtentX() + 1, vYCor, 75, "Arial", 15, 0)
	PrintString(@FormFieldValue("Gems", "Shape", vSub), @PageExtentX() + 1, vYCor, 130, "Arial", 15, 0)
	PrintString(@FormFieldValue("Gems", "Color", vSub), @PageExtentX() + 1, vYCor, 100, "Arial", 15, 0)
	PrintString(@FormFieldValue("Gems", "Size", vSub), @PageExtentX() + 1, vYCor, 100, "Arial", 15, 0)
	PrintString(@FormFieldValue("Gems", "Weight", vSub), @PageExtentX() + 1, vYCor, 65, "Arial", 15, 0)
	PrintString(@FormFieldValue("Gems", "Clarity", vSub), @PageExtentX() + 1, vYCor, 90, "Arial", 15, 0)
	vSPrice = @FormFieldValue("Gems", "Price", vSub)
	vPrice = @ToMoney(vSPrice)
	vsPrice = @Decimals(vSPrice, 2)
	PrintString(@Text((9 - @len(vSPrice)) * 2, " ") + "$" + vSPrice , @PageExtentX() + 1, vYCor, 100, "Arial", 15, 0)

	vPriceTotal += vPrice  // Total price being counted up
	vSub = vSub + 1
}
FormResultSetCurrentPosition("Gems", 1)


//List total cost of all gems and finish the page
//Note the following line will need to be changed if a different money symbol other than $ is desired.
PrintString("Total value of Gems listed is: $" + @Decimals(VPriceTotal,2), 50, @PageExtentY() + 20, 0, "Arial", 20, 0)
FinishPage()
 



The code may or may not need some adjustment to work with the trial sample app.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
jondolar
Junior Member
**
Offline


Keep Trying

Posts: 57
Location: Montreal Canada
Joined: Dec 25th, 2003
Re: Printing Records and Subrecords with PrintStri
Reply #2 - May 24th, 2004 at 2:27pm
Print Post Print Post  
Hi Erika

Thanks for the code. It works perfectly....as advertized.... Wink

     Since we are on the subject of reporting, I have played quite a bit with Sesame Report Writer. Using the example in the Userguide starting on page 345, I tried to put static text (element labels) in the page header section but tey don't print. The following is mentioned in the Userguide on page 338...Sesame provides you with the ability to set page headers, footers and breaks in reports but depending on your operating system, browser version and browser settings, these may not appear in your output....I'm on Windows XP Pro and I use Outlook Express V6. What are the exact conditions or settings that would ***allow*** Page header static text to print? Could another Browser do the job?

Thanks for your help Kiss

Serge
  

When all you have is a hammer, everything starts to look like nail!
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Printing Records and Subrecords with PrintStri
Reply #3 - May 24th, 2004 at 2:37pm
Print Post Print Post  
The browsers (all browsers) create their own page breaks and are quite bizarre in that the settings for what appears are stored in the registry! It makes it difficult for us to override them, although we are working on it. An upcoming version will likely allow you to set these options as part of your report design.  Since Sesame reports create a web page, it is all really one "page" until the printer gets ahold of it.

The Page Headers and Page Footers in Sesame reports can be made to appear if you place a Page Break element in a freeform section of your report. They will appear in addition to, rather than overriding the Page Headers and Footers that your browser provides. The concept of Page Headers and Footers does not mesh well with the concept of HTML. If Page Headers and Footers are paramount, you may want to explore the PrintString options.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
jondolar
Junior Member
**
Offline


Keep Trying

Posts: 57
Location: Montreal Canada
Joined: Dec 25th, 2003
Re: Printing Records and Subrecords with PrintStri
Reply #4 - May 24th, 2004 at 4:09pm
Print Post Print Post  
Thanks again Erika

I'm not making a free form report rather, a columnar report and I don't use page break. I follow exactly the example of the Userguide. Can I still have static text appear in a page header? How?

Regards

Serge
  

When all you have is a hammer, everything starts to look like nail!
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Printing Records and Subrecords with PrintStri
Reply #5 - May 24th, 2004 at 4:57pm
Print Post Print Post  
You'd need to set it up in your browser itself. At this point, we don't have any control over it, although we may in a future release.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
jondolar
Junior Member
**
Offline


Keep Trying

Posts: 57
Location: Montreal Canada
Joined: Dec 25th, 2003
Re: Printing Records and Subrecords with PrintStri
Reply #6 - May 24th, 2004 at 7:17pm
Print Post Print Post  
Hi

I think I understand. In Explorer, File, Page Set Up, allow you to write some text in a Header and Footer. Not very practical  Undecided since you have to change that manually for every report plus the fact that it's impossible to line up Element Labels for each collumn. Hope you come up with something in some future version.

Regards

Serge
  

When all you have is a hammer, everything starts to look like nail!
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Printing Records and Subrecords with PrintStri
Reply #7 - May 24th, 2004 at 8:06pm
Print Post Print Post  
jondolar,

Try putting the static text in the "Group Header". This section tends to line up with the "Group Body" columns.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
jondolar
Junior Member
**
Offline


Keep Trying

Posts: 57
Location: Montreal Canada
Joined: Dec 25th, 2003
Re: Printing Records and Subrecords with PrintStri
Reply #8 - May 24th, 2004 at 8:14pm
Print Post Print Post  
Hi Carl

This is what I do but this is good only for the first page of the report. If my report is 3 pages long, the columns headings (elements labels) do not repeat on page 2 and 3.

Thanks anyway

Serge
  

When all you have is a hammer, everything starts to look like nail!
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Printing Records and Subrecords with PrintStri
Reply #9 - May 24th, 2004 at 8:18pm
Print Post Print Post  
Oh yeah, I forgot about that. I also would like them to repeat at the top of each page.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
jondolar
Junior Member
**
Offline


Keep Trying

Posts: 57
Location: Montreal Canada
Joined: Dec 25th, 2003
Re: Printing Records and Subrecords with PrintStri
Reply #10 - May 25th, 2004 at 6:27pm
Print Post Print Post  
Hi Erika and Carl

One final word on using PrintString vs Report Writer with Sesame.

The Sample application....Printing Records and Subrecords with PrintString....does indeed produce a precise report formatting but it took 50 lines of code to do so by someone obviously quite familiar with Sbasic and someone who has a quite a bit of imagination to visualise each elements on the printed page and include the proper coordinates in the code. This is not easy. I hope that Sesame Report Writer is reworked to include more facilities for page headers and footers allowing quick and easy reports. Wink

Regards

Serge
  

When all you have is a hammer, everything starts to look like nail!
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Printing Records and Subrecords with PrintStri
Reply #11 - May 25th, 2004 at 6:49pm
Print Post Print Post  
Serge,

The point of the sample was to demonstrate precision printing and looping through subrecords in SBasic, not to demonstrate the simplest way to create a report.

You can also do this with a report/subreport from the Report Designer, with the exception of Page Headers and Footers.

We traded Page Headers and Footers for the tremendous power and transportability of HTML. HTML can be used and imported by many other programs, such as Word, Access and Excel. HTML reports can be emailed or mounted online without any further processing. They can be interactive (clickable). They automatically adjust themselves to fit on screen or printed page. Etc... Time will tell if Page Headers are so overwhelmingly important to people that all other benefits become irrelevant.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
jondolar
Junior Member
**
Offline


Keep Trying

Posts: 57
Location: Montreal Canada
Joined: Dec 25th, 2003
Re: Printing Records and Subrecords with PrintStri
Reply #12 - May 25th, 2004 at 7:12pm
Print Post Print Post  
Hi

No doubt that HTML is flexible, versatile etc. etc. But as a developper in FileMaker Pro for the last 7 years, I have yet to have a project not requiring reports several pages long. Any report 2 pages long or more requires a header to repeat elements labels on each page. Smart programmers like Mark and yourself should be able to trick the Report Writer and HTML to allow a page header. But as you say Quote:
Time will tell if Page Headers are so overwhelmingly important to people that all other benefits become irrelevant.
.

Sincerly Cheesy

Serge
  

When all you have is a hammer, everything starts to look like nail!
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Printing Records and Subrecords with PrintStri
Reply #13 - May 25th, 2004 at 7:18pm
Print Post Print Post  
In the end, Sesame does not actually print your report. On Windows the operating system's HTML Printer (an included .dll) actually prints the report. Sesame merely sees it as another document (a file). On Windows the the page header and footer information is stored in your registry(!). Sesame could alter these and then restore them when printing is complete. I've experimented a little with this technique and got it to work. But the user still does not have page by page control over the content, and the content formatting allowed by the OS is very "lightweight". Additionally, I really don't like the idea of altering your registry settings on the fly. On Unix, the printing is done by a html to postscript conversion (producing a file - not a print) that gets sent to the user specified "lp/lpr" device. Here there is some leeway in term of page header and footer specifications - but still not enough.

We have been looking for a good HTML library to parse and print the HTML with callback notification, so that Sesame can intervene and insert page headers and footers, yet not interfere with using the HTML as a "document" as opposed to the printed piece of paper.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
jondolar
Junior Member
**
Offline


Keep Trying

Posts: 57
Location: Montreal Canada
Joined: Dec 25th, 2003
Re: Printing Records and Subrecords with PrintStri
Reply #14 - May 25th, 2004 at 8:26pm
Print Post Print Post  
Mark

I'm glad that there is some hope Quote:
We have been looking for a good HTML library to parse and print the HTML with callback notification, so that Sesame can intervene and insert page headers and footers, yet not interfere with using the HTML as a "document" as opposed to the printed piece of paper.

I'm sure you'l find something. Hope it won't be too long.

Good luck and thanks

Serge
  

When all you have is a hammer, everything starts to look like nail!
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 3 
Send Topic Send Topic Print Print