Showing posts with label pages. Show all posts
Showing posts with label pages. Show all posts

Wednesday, March 28, 2012

how to create pages on-the-fly

Hi,
Its a simple requirement but i have failed to figure it out.
I have a Report.rpt file which is printing some text inputted by the user and it is going to print the number of copy of the pages (like "Page N of M" in crystal report) which is also given by the user.

i.e. if the user inputs 3 as the number of copy it is going to print, the Report needs to be build with creating 3 pages and following text needs to be there :
Page 1 of 3
Page 2 of 3
Page 3 of 3

The problem is to create these 3 pages in the report.

There is no group inserted and connection with any source. Only the text value and the value for the number of pages send from VB6.

I could have send the report to the printer M# of times, depending on the value of M given by the user But it is not a good one and i also need to give the option to choose the printer to the user (crxRpt.PrinterSetup 0 ). And that solution is going to ask to choose the printer for each page.

May be its a dump question but i am in pain. Please think for a while to help me out.

Regards
-JoyshimaWhy do you want to do this?
I dont think this is possible
Can you explain more?|||Thanks for your responce. I was waiting for you.

I am doing it for a nursing home and they need to take print out of some kind of header card. Lets say they need to print 3 header card and they will be as follows :

------
Header 1 of 3
XXXXXX
------

------
Header 2 of 3
XXXXXX
------

------
Header 3 of 3
XXXXXX
------

So the input is the total number of the header card and the text they want to be printed on it. Also I need to give them the option to choose the printer before printing and number of copies they want.

Please suggest me something for it.|||Instead of Page 1 of 3 do you want to show it as header 1 of 3?|||"Page 1 of 3" or "Header 1 of 3" that text is not the problem. The problem is to create that 3 pages according to users input.

I have created two parameter on which i am sending (from VB6) the value for the text "XXXXXX" and the value that the user inputs (i.e. for the example it is 3).

Now with this information i need to create the pages (i.e. 3 page) and print the text and the header/Page text.

Any idea? how can i?|||You need to have a table having these information
Text
Header

When user inputs those say "XXXXXXX" and 3, insert three records to that table having
XXXXXXX header 1 of 3
XXXXXXX header 2 of 3
XXXXXXX header 3 of 3

Now design a report based on this table
Group it by first column
Right click on Group header and select Section Expert
Check the check box, "New Page After"

Try it and see what happens|||Yes Madhi, I have done this to give the solution, but couldn't like that. For a small amount of data you need to carry a database and table - too much heavy. And also it is simple task to print some text on page.

Is it possible to create recordset without any table from VB6? If i can put the data as three record inside that recordset and send it to the report file (rpt file), i may be able to have three pages from it.

Therefore the three record on the recordset would be :
XXXXXXX header 1 of 3
XXXXXXX header 2 of 3
XXXXXXX header 3 of 3
This is only my idea. Let me know your opinion.
-Joyshima|||I am not sure about your point

See if this supports your point
http://support.businessobjects.com/library/kbase/articles/c2011950.asp

Wednesday, March 21, 2012

How to create a torn page.

I want to write a magazine article about torn pages. Is there an easy way to create a torn page? Or does anybody have a backup of a sample database such as AdventureWorks that has a torn page?

I suppose you have to simulate a disk failure at the right moment. I don't think it is very easy to simulate tbh.

But do keep us informed if you find a way to do so.

|||

To simulate a torn page, you'll have to "corrupt" a database page on disk.

This can be done with a hex editor, or other tool.

Our pages are 8K in size, so 16 sectors of 512bytes.

We have 2 kinds of validation: checksum or torn page.

For the torn page, you'll want to corrupt bytes at 0 mod 512 in sectors 1..15 of a page. You could write 0x00 at offset 512, and 0xFF at offset 1024, for example.

Checksums are more robust, so you should be able to change any bit on the page to cause the corruption to be detected.

In order for this corruption to cause any problem, you'd have to pick a page that actually holds data, and then cause the engine to try to read that page.

Hope that gives you some ideas.

|||

Aah, think out of the box :-)

Great tip.

Monday, March 12, 2012

How to create a field that may accoss multiple pages?

I have a memo field that may not fit into one page. Is there any solution to let crystal report create multiple pages automatically at runtime? Splitting the string manually may not be the solution because how many characters are displayed for each page cannot be determined at the design time.

Thanks in advance!Doesn't the 'Can Grow' option work? (Right click field, Format Field, Common tab)?|||'Can Grow' does not work because the displaying area has to be fixed while the message may be too long to fit into one page.

Wednesday, March 7, 2012

How to create .dbf file from within asp.net pages?

Hi,I'd like to create a single .dbf file from within my asp.net application and populate it with some data in SQL Server database,How can I do?Any help will be greatly appreciated!Thanks in advance!You could try looking at the xBase Engine for C# and ASP.NET, written by Ricardo Federico Villafañes:http://www.c-sharpcorner.com/Code/2002/Feb/xBaseEngineRFV.asp

Terri