|
Ei guys, I would like to share a problem with you. I am doing a project that requires me to print a letter-like report which consists of the ff. part:
---------------------------------------------------------------------------------------------------
___________ [Main Reference No]
___________ [ Additional Reference Nos ]
___________ [Date]
___________
___________ [Heading (The recipient]
___________
___________ [Greeting]
______________________________[Opening Letter]__________________________
____________________________________________________________________________
____________
____________
____________[List of Items from a Database Record
____________
______________ __________________ __________________ ______________
______________ __________________ __________________ ______________
______________ __________________ __________________ ______________
[Rows of Records from the database with 4 Columns]
______________________________[Body of the Letter]_____________________
___________________________________________________________________________
__________________________________[Closing]_____________________________
____________________________________________________________________________
___________________ _______________________
___________________ [Signatures] _______________________
___________________ _______________________
----------------------------------------------------------------------------
REQUIREMENTS:
- The main part of the letter (Opening, Body and Closing) requires to be dynamically generated. That is the user is free to choose what format he wants. (Font Type, Font Size, Font Styles (Bold, Italic and Underlined), Alignments, Bullets, etc. I've develop a program for this.
- If the report has more than one pages, the rest of the pages(except page 1) should have a HEADING that is made up of the Recipients Name, Main Reference No, Date, Page No and a line, then print whatever is left from the previous page. See illustration.
----------------------------------------------------------------------------
_________________ [Recipients Name]
_________________ [Main Reference No]
_________________ [ Date]
_________________ [Page No]
_________________ [A line]
;PREMAINING CONTENT
----------------------------------------------------------------------------
Proprietary reporting tool such as crystal reports, if Im not mistaken, doesnt support this kind of reporting. Correct me if Im wrong coz Im a bit new to Crystal Reports and if it indeed does support that reporting, then its gud news, and Im very eager to know it. But since, I assumed its not possible with Crystal, I turned my attention to the printing classes provided by the .Net Framework.
I have read two articles from Microsoft Library's .Net Development Articles and Columns. The first one was discussing about and extended RichTextbox class inherited from the RichTextBox class of the .Net Framework. This control offers one very important feature, the Print Method, which directly prints the content of the RichTextBox, with all its formatting into the PrintDocument. Exactly what I needed for the first requirement.. On the other hand, the second article was again about an extended classes, this time, inherited from PrintDocument and PrintEventArguments classes. It provided functionalities like writing text into the document (using graphics.drawstring), tracking of X and Y coordinates of the imaginary cursor on the page, and added some events for purposeful tasks.
Thanks to the author of those articles.
COMBINING THE TWO IDEAS
.
After studying the two articles, I came up with an idea to combine them. What I wanted to achieve with this is that at the printpage_event where the actual printing of contents is done, I want to print a text on the page using the write function of the second extended class or simply using the graphics.drawstring method and then print the content of the RichTextBox keeping all the format made by the user, and again print another using the former to display database records with rows and columns and vice-versa.
THE PROBLEM
-The problem is, the texts I've written using either write or drawstring methods didnt appeared on the page. It seems the contents of RichTextBox that were also being printed have covered them. So I have to think for another idea.
I came up with putting all the contents of my report to the RichTextBox control and from their, do the formatting or layouting. But another problem is Im having difficulties aligning rows of records in tabular format and the HEADER Im talking about on the Requirements couldnt be printed with this approach.
Is there any way I can achieve the expected output? Im hoping and believing I can get solution from the ideas of good and experienced programmers/developers here. Im thanking you in advance for any ideas you can give and for the time you've alloted reading this long query. Many thanks.
Oops, I forgot to mention.. I am using VB.NET 2003(.net framework 1.1). Thanks Again.
programming_lesterbryan.cuenca@yahoo.com.ph
|
|
|
|
|
I am Doing Datagrid Editing.While i am updating Data it is not showing any error but doesn't display Syntax Error Also .This is My Code i have placed
Datagrid_UpdateCommand
----------------------
Dim conn As SqlConnection
Dim MyCommand As SqlCommand
Dim strConn As String = "Data source=B4-2F-128-HTB2\SQLSVR; user id=sa; password=; Database=New_Cart"
Dim txtQty As TextBox = e.Item.Cells(3).Controls(0)
Dim strUpdateStmt As String
strUpdateStmt = " UPDATE ProductDetails SET Qty =@Qty " & _
" WHERE Pcode = @pcode"
conn = New SqlConnection(strConn)
MyCommand = New SqlCommand(strUpdateStmt, conn)
MyCommand.Parameters.Add(New SqlParameter("@Qty", txtQty.Text))
MyCommand.Parameters.Add(New SqlParameter("@Pcode", e.Item.Cells(1).Text))
conn.Open()
MyCommand.ExecuteNonQuery()
MyDataGrid.EditItemIndex = -1
conn.Close()
BindData()
Siddu
Software Developer
|
|
|
|
|
How to use this CopyMemory() of kernel32.dll in Vb 2005 for Printing a Document.This function Stores the Buffer Data which is to be printed?
Rekha
|
|
|
|
|
I want to print the documents one after after the other sequentially and also every document should start with a new page. How this can be done?
Very Urgent
Rekha
|
|
|
|
|
At the end of the first page set e.HasMorePages = True and the PagePrint event will fire again - print the second page at that stage and so on.
|
|
|
|
|
How to add new rows automatically depending on a new row entry in the Data Grid. The new rows must be added below the currently entered row automatically (depending on a column value). The datagrid is bound to a table in MS-Access 2000 Database.
-Madhu
|
|
|
|
|
add to rows count of datagrid property
|
|
|
|
|
Hello, all.
I've been working on a timer program that I can install on my sons computer in order to allow him a specific amount of time in the evenings/weekends. I've got the program all coded except for one feature:
1. When the timer completes it countdown, I'd like for it to take control of the operating system and pop up a password box that, until the correct psw is entered, essentially prevents the computer from being used (or something very close to that).
I've searched extensively in many forums but have been unable to find anything that fits what I am looking for.
Does anyone have information they can provide in order to code this in vb.net?
Sincerely,
Harold
|
|
|
|
|
I once made something similar, the way i resolved it was to make a form with no border, it was completely black and took up the whole screen, when i showed this form i said:
form1.showdialog
Then I had my password form popup in front of that also using showdialog. Showdialog means you can't do anything with the program until the dialog form has been taken away. This means, if the form blacked out the whole screen, you could not click the start button or anything.
To find screen resolution height and width so it works on any resolution:
My.Computer.Screen.Bounds.Width<br />
My.Computer.Screen.Bounds.Height
Use these values to size your blackout form and set the password box to show centre screen. Make sure both forms have the topmost property set to true.
Now, you will also need to block key combinations like Alt-Tab, Alt-F4, Control-F4, the start buttons and Control-Alt-Delete Right?
Put these if statements in the keydown event for BOTH FORMS (the keypreview property should be true for both forms), these will block all common key combinations except control-alt-delete, these will not block the start buttons either:
If e.Alt Then<br />
If e.KeyCode = Keys.Tab Then<br />
e.Handled = True<br />
End If<br />
If e.KeyCode = Keys.F4 Then<br />
e.Handled = True<br />
End If<br />
End If<br />
If e.Control Then<br />
If e.KeyCode = Keys.F4 Then<br />
e.Handled = True<br />
End If<br />
End If<code><br />
<br />
As for blocking task manager i'm not sure, if your son has a limited account i think it can be blocked, for that account, not sure though. But this should get you started. To block the start buttons, i know there is a way to hide the start menu ro disable it, this may help.<br />
<br />
<br />
<br />
<br />
-- modified at 23:57 Friday 8th December, 2006 <br />
<br />
<div class="ForumSig">Posted by The ANZAC</div>
|
|
|
|
|
how I can programming to conecting with mopile via the bluetooth tocnology
by using vb.net if you please .
thanks
|
|
|
|
|
I have code working (in VB.Net 2.0, VS2005) to create a windows form control (Windows Control Library), then host that control on a web page (in IE7).
I found a couple of online tutorials for doing this here:
http://support.microsoft.com/default.aspx?scid=kb;en-us;305624
and here
http://msdn.microsoft.com/library/default.asp?url=/msdnmag/issues/02/01/UserCtrl/TOC.asp">http://support.microsoft.com/default.aspx?scid=kb;en-us;305624
However, both of these articles stop short of telling how to get the Javascript on the web-page to respond to events from the Windows Form control! The second one shows how to do it in C#/C++, but not in VB.Net.
Anyone know if it's possible? And if so, How?
TIA,
Owen
|
|
|
|
|
How do you send characters to another application's Text Box when that text box is controlled by code that formats the data. I have a legacy application (without source code of course) that I would like to control. I can write just fine into Text Boxes that just accept characters -- but this instance is a Text Box where the legacy code is looking in the Keyboard Buffer for characters and then formatting what is displayed. In other words, its stuffing in the dollar sign ("$") automatically.
This works fine for ordinary Text boxes but not for the ones that format the text box contents:
SendMessageText(WINDOWHANDLE, WM_SETTEXT, Len(TEXTMESSAGE), TEXTMESSAGE)
It seems as if I need to write to the Keyboard buffer so the Legacy Application can process it --- but when I tried that I learned that you have to switch the focus to the Legacy Application because only focused applications can access the Keyboard buffer.
Anybody have a code fragment that can do this?
Thanks
Carl
Carl@CarteBlanc.com
|
|
|
|
|
I am working on an ftp application that will download files from my companies various servers. Once the file has been downloaded a menu will appear and give users the option to click on a link label and open a specified folder that contains the downloaded file. The problem I am having is finding a way to open a folder in windows explorer. Does anyone know how to do this? I have found some examples that use the "shell" command but i can never get it to work.
Thanks
|
|
|
|
|
How can I allow users to upload photos to my website? I need them to be able to browse their own hard drive to submmit the file. I then need to check the size and rename.
rob mackey
|
|
|
|
|
How can I best add a forum to my website?
rob mackey
|
|
|
|
|
Try asking in the ASP.net Forum. That's for website developement.
Posted by The ANZAC
|
|
|
|
|
I've been converting / writing a handful of apps using Visual Studio 2005 and publishing the files for ClickOnce upgrades.
When we wrote applications with VS2003 we setup app-config files and could change parameters in our apps by adjusting the app-config without recompiling.
Now with ClickOnce we publish to a location on our intranet and install the app on each local workstation. Where is the app-config. It seems like we now have to change the app-config in Visual Studio and re-publish. There should be a way to just go to the app-config at some central location to change parameters if needed?
I'm missing some piece of knowledge that hopefully somebody has.
Thanks for any help
Lost in the vast sea of .NET
|
|
|
|
|
I would like to consume a wevbserice with VB.NET, but I would like to set the URL dynamically because the host for the service might change. I can set the URL be editing the webrefrence but I can not seem to change it programmatically.
I have created a reference to MyService
private service = new MyService.Service
I have tried
service.Url = userInputUrl
but when I try to compile I get a lot of errors like
This is not a member of MyService.
Any ideas.
|
|
|
|
|
hi all!
i beg to know if there is any way to convert any compiler file (.parse)into text file.
thanks
|
|
|
|
|
gyangyan wrote: i beg to know if there is any way to convert any compiler file (.parse)into text file
Is it already in text?
If you try to write that in English, I might be able to understand more than a fraction of it. - Guffa
|
|
|
|
|
Hi,
I am trying to run a VB6 application in Windows PE. VB application uses SSTAB control for user interface. WinPE gives an error message stating:
"Failed to load control SSTAB from TABCTL32.OCX. Your version of TABCTL32 maybe outdated. Make sure you are using the version provided with your application."
I have tried to load newer version of TABCTL32.OCX by first unregistering them from Windows System32 folder and then re-register by executing regsvr32 command on both machines where I developed VB6 application (which uses Windows XP Professional) and on WinPE machine. But still to no avail. Problem presists.
Any input will be appreciated. Thanks.
one-trick-pony
|
|
|
|
|
Hello ,
How can any service install programmatically in windows 2003 server ?
For Example :
Control Panel -> Add or Remove Programmes -> Add or Remove Windows Components -> and from Networking Services Group, install DHCP SERVER, Select Remote Installation Service Group check box (For Installation of TFTP Server)
This is manual process , but i want to do this thing in single click by programmatically .
Please, guide me.
pwk
|
|
|
|
|
If any one has source code of computer Lab managament system in VB .NET programming language then reply me
-- modified at 1:48 Thursday 14th December, 2006
Girish
|
|
|
|
|
girishpalmah wrote: If any one has source code of computer Lab managament system in VB .NET programming language then reply me
What do you wish to monitor?
If you try to write that in English, I might be able to understand more than a fraction of it. - Guffa
|
|
|
|
|
Hi, I have a real problem
I have been trying for days to thik of a solution for the following;
I have a table called AccessGroup and another called AccessPermission. I have a link table between the 2 because you have any number of AcessGroups assigned to any number of AccessPermissions.
When I want to ADD an access group, I simply input and Name for the AccessGroup like ADMIN. Then I select from a DataGrid, using checkboxes, AccessPermissions. I can choose as many as I want. When I click on SAVE, the link table will be populated with the relationship between the ADMIN AccessGroup and the AccessPermissions Chosen.
Here's the problem. When I select an AccessGroup from a DataGrid for updating, The ADD page appears with a textbox loaded with "ADMIN" and it is ReadOnly. That's fine. What I also want is for the checkboxes in the DataGrid which has all the AccessPermissions in a list to be CHECKED depending on what AccessPermission are assigned for that AccessGroup.
I hope that made sense. Please help.
Thanks!
|
|
|
|