|
thanx, ill go search on MSDN
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
Hello Friends,
I have a problem with print and print preview.
I am using the following code to print:
This print the image but there is one problem that it print one image on one page as i want it should print 4 images on one page so how can i do that.
Bitmap memoryImage = new Bitmap(panel1.Width, panel1.Height);<br />
panel1.DrawToBitmap(memoryImage, panel1.ClientRectangle);<br />
printDocument1.Print();
And how can i show Print Preview of these images before printing
|
|
|
|
|
You need to draw four images when you're printing, they you'll have four images. The best way to do this is to handle your onpaint event, and if you're printing when it occurs, get the printers page size and draw your bitmap four times accordingly
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
To invoke a webservice, we usually generate web referece based on wsdl generated code and use it.
Instead, if i have to dynamically invoke a web service method, given that i know the following
- URL with ip
- Service name
- port
- namespace
This is available in java, sample code given below. I need to implement the same in c#. Any pointers will be a BIG BIG HELP for me
//URL wsdl = new URL(url);
String tempServiceName = getServiceName(serviceName);
QName serviceQName = new QName(targetNameSpace, tempServiceName);
QName port = new QName(targetNameSpace, portName);
QName operation;
operation= new QName(targetNameSpace, reqInfo.getRequestMethod());
org.apache.axis.client.ServiceFactory factory = new ServiceFactory();
//org.apache.axis.client.Service service = (Service) factory.createService(new URL(url), serviceQName);
org.apache.axis.client.Service service = (Service) factory.createService(serviceQName);
org.apache.axis.client.Call call = (org.apache.axis.client.Call) service.createCall(port, operation);
call.setReturnType(XMLType.XSD_STRING);
call.addParameter("string", XMLType.XSD_STRING, ParameterMode.IN);
//-------------settign the header
org.apache.axis.message.PrefixedQName svcName = new org.apache.axis.message.PrefixedQName("http://schemas.xmlsoap.org/ws/2002/07/secext", "Security", "wsse");
org.apache.axis.message.SOAPHeaderElement sh = new org.apache.axis.message.SOAPHeaderElement(svcName);
javax.xml.soap.SOAPElement sub = sh.addChildElement("UsernameToken");
javax.xml.soap.SOAPElement element = sub.addChildElement("Username");
element.addTextNode(userName);
element = sub.addChildElement("Password");
element.addTextNode(password);
call.addHeader(sh);
//------------
// int iIndexWsdl = url.indexOf("?");
// String strEndPointAddress = url.substring(0, iIndexWsdl);
call.setTargetEndpointAddress(url);
// String requestXML= CommonHelper.getInstance().loadFile(reqInfo.getRequestXML().trim()).toString();
logger.info("request XML:"+reqInfo.getRequestXML());
//long startTime=logger.perf("calling webservice");
long startTime= System.currentTimeMillis();
String response = (String) call.invoke(new Object[]{reqInfo.getRequestXML().trim()});
// long endTime=logger.perf("timeTaken for webserviceCall:",startTime);
long endTime=System.currentTimeMillis();
GHanesh
|
|
|
|
|
Hello,
I have a specific format of writing XML for which i use XML notepad editor. As the schema and format of XML is same and only contents differ so i want to design some tool to write the XML with predefind components.
In nutshell, i want something like class view desiner in C#. The classes are my nodes and the properties contains the information about that node. So i just pickup those predefined components(classes) from pallet, edit theire properties and add child node(class) by defining theire relationships.
The final output(export) of the file(relationship) should be in XML format.
This will give very intutive way to create and visualise process and coverted to XML.
What is the best way to implemet this concept?
I am using windows form but i don't know how can i get the components pallet view and the class designer view window?
Thanks & Regards
Gajesh
modified on Thursday, March 6, 2008 10:48 PM
|
|
|
|
|
In my book, XML is so simple that a tool like that would just get in the way.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks Christian,
Which book you are talking about?
Would you please give me the online reference or other details of the book.
regards
Gajesh
|
|
|
|
|
hi all ..
i am devoloping a windows service which performs a task periodically.
For that, i used system.threading.timer. Every thing is fine but when the time to complete the given task is more than the time interval of 'system.threading.timer', then the task would be performed agian .
For that i need to stop(or pause) 'system.threading.timer ' while my task is performing.
Any body is knowing any information in this regard ,plz help me.
thanks in advance
Regards ,.
Kiran
|
|
|
|
|
If you use System.Timers.Timer instead, it has an Enabled property.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Yeah, that's what I use too. Or .Start() and .Stop()
|
|
|
|
|
Hello,
I have created an excel spreadsheet file using the ole database engine. I have it populating the file without a problem. I am now trying to insert a blank lines into the file to make the transition look better. The way I am currently doing it is
string InsertStatement;
InsertStatement = "Insert into [tabname$] (";
for(int i = 0; i < ExcelColumns; i++)
{
InsertStatement += "null";
if(i < ExcelColumns-1)
InsertStatement += ",";
}
InsertStatement += ")";
then I put that into a oledbcommand and my connection to the excel file. The the rest of it works fine. But the blank line does not.
Any help would be greatly appreciated.
|
|
|
|
|
Hi!
We can write something on the console window using Console.WriteLine. I want to write something on console in some color like Red or blue. How can i do so ?
Imtiaz
|
|
|
|
|
|
And since .Net 2 you can just use the handy properties in the Console class:
Console.BackgroundColor<br />
Console.ForegroundColor
Then just set them to Color.Red for example, background will obviously change the background colour, and Foreground will change the text colour.
My current favourite word is: Nipple!
-SK Genius
|
|
|
|
|
hi,
i want to create a backup server by using C# and MS-Sql. but dont know how i start. plz tell me complete process. if source code is available then send me that plz.
regards
tanoli
|
|
|
|
|
The complete process is that you define exactly what your program will do, then you do some reading to work out the best way to do those things, then you write the code.
What do you want to achieve exactly ? Although, this is the wrong place to ask 'how do I write this program and please send me source code'. We usually help people who have a specific problem they want help with. I'm not sure how I could answer your question in the context of a forum reply.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Sure. Why not? Although you will need to send my company a cheque for £450 and I will send it to you as soon as your cheque clears and the money appears in our bank account.
|
|
|
|
|
I can not find this information about something I'm trying to do in a richtextbox.
Basically I want to set the horizontal alignment to the right, THEN print some text.. put in a couple blank lines and set the Hortizontal alignment to the center.. I am wanting the colors to be different. Basically I want the alignment of different for different sections. All I see is selection alignment when actually I want to set the alignment of the current position and then print text..
A format like this:
Myname
Address <-- Size 8 Font
City, State, ZIP <-- All this is set to RIGHT
Social Security Number
Childs Name <-- (Color red and size 14 Font) <-- SET TO CENTER
Start Date: 00/00/0000
Paid in (year): $923423 <-- ALL THIS SET TO LEFT
and some more information....
How would I do this since I'm print then setting the alignment or if I print then try to set it how do I select only certain things?
Also is there a page break for richtextboxs for printing purposes?
|
|
|
|
|
|
Not exactly the answer to your question, but if add a document to your application you can replace your RichTextBox with a PrintPreviewControl, you can do any sort of layout you wish. Simultaneously, you can go from printPreview to real printing and it will keep the layout.
The drawing tools will allow you to just plain go crazy with elaborate formatting/shading/lines, etc, if you've a notion to.
At least that's how I do it.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein
"How do you find out if you're unwanted if everyone you try to ask tells you to go away?" - Balboos HaGadol
|
|
|
|
|
I will have to check that out... I haven't done much with PrintPreviewControl. I'll have to research some more information about it.. thanks.
|
|
|
|
|
I was wondering.. what do you mean add a document? I still have to take the information and write it to a document? Do I do that then load the document in the printpreviewcontrol and then do editing?
|
|
|
|
|
Without going into the whole document interface thing in any detail:
You need to add a printDOcument object to your application. You write to it through its Graphics object.
Now, if you create a printPreviewControl (or dialog), it allows you (check the properties) to add a document (which is in its select list if you click the blank box). What this connection does is tell the preview which document to look at [you could use the same printPreview for multiple documents by changing that assignment at RT).
Anyway, you need to explore this, and some examples, but basically, you can write to the document anywhere, in any order, with various pens (thickness, linestyle, color, ...), brushes, fonts, lines, shapes. After a break-in period, you can do shading, too. Also, add graphics.
Much "richer" than the rich text box: downside? You can't type into it on the screen - it's a display method, and WYSIWYG print method. If you need to have the user type directly into the box, you're out of luck, unless you work-around (ex: enter name in simple text-box, and update the printPreview either as they go along, when the box loses focus, or when the press an update button.
I don't know your final needs, so I suggested a print/display oriented item rather than an editbox type item.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein
"How do you find out if you're unwanted if everyone you try to ask tells you to go away?" - Balboos HaGadol
|
|
|
|
|
I get how to do some of the things now.. I just don't understand how to right align the words. I know how to left align the words but thats because they go from left to right.. How do I right align the words and make them go right to left? Does that make any sence?
e.Graphics.DrawString("Jacob Dixon", Tfont, Tbrush, rightalign, yPosition);
that sets the beginning of the text to where the right margin is.. well here is the rest for the right margins:
float rightalign = e.MarginBounds.Right;
Now how to I convert the drawstring to print right to left and not left to right like normal?
|
|
|
|
|
Ok I have figured that one out.. There is not much information out there about what I am looking for. Do you know where I can read up on some of this?
Now I'm looking for, I have a foreach statement for each of the children in the database. Now for each child I want it to print to a different page... What is is suppose to do is print out a end of year report for the parents of how much they paid that year.. now I have the settings and it prints the information, but how do I tell it to start printing on the next page for each child?
|
|
|
|