|
You are corecct!!! (Ding Ding Ding Ding Ding!!!) I fixed your qouts in my post here.
|
|
|
|
|
well as I see you don't leave spaces and don't put everything in it's place... (and there are alot of things that could be shorten...)
try this:
startInfo.Arguments = "\"" + @Convert.ToString(TempPath) + "\\fop.bat\" -xml \"" + @Convert.ToString(TempPath) + "\\ClientRecordCard.xml\" -xsl \"" + @Convert.ToString(TempPath) + "\\" + @Convert.ToString(TempName) + ".xsl\" -pdf \"" + @Convert.ToString(Salon.Library.GlobalVariables.Reports_Path) + "\\ClientRecordCard.pdf\"";
this SHOULD work, but I don't promis you cuz I don't realy know what you after here.
NaNg.
|
|
|
|
|
thank you, ill give it a go.
He who laughs last...
|
|
|
|
|
|
hi,
sorry, it didn't work
public void shellControl2()
{
if(CustCd != "")
{
ProcessStartInfo startInfo = new ProcessStartInfo("cmd.exe");
// /c switch sends a command
startInfo.Arguments = "/C " + "\"" + @Convert.ToString(TempPath) + "\\fop.bat\" -xml \"" + @Convert.ToString(TempPath) + "\\ClientRecordCard.xml\" -xsl \"" + @Convert.ToString(TempPath) + "\\" + @Convert.ToString(TempName) + ".xsl\" -pdf \"" + @Convert.ToString(Salon.Library.GlobalVariables.Reports_Path) + "\\ClientRecordCard.pdf\"";
// redirect messages to this program
startInfo.RedirectStandardError = true;
startInfo.RedirectStandardOutput = true;
//don't execute using shellexecute API
startInfo.UseShellExecute = false;
//Don't open command prompt window
startInfo.CreateNoWindow = true;
System.Diagnostics.Process p = System.Diagnostics.Process.Start(startInfo);
string output = p.StandardOutput.ReadToEnd();
string error = p.StandardError.ReadToEnd();
p.WaitForExit();
if (output.Length != 0)
{MessageBox.Show(Convert.ToString(output));
shellControl1.WriteText(output);}
else if (error.Length != 0)
{MessageBox.Show(Convert.ToString(error));
shellControl1.WriteText(error);}
}
}
This is the code snippit i'm using to send a command to command prompt to run the fop batch file to create a pdf file from xml and xsl files. if you can help it would be great. i had it working fine when all the files were in "C:\Reports\" But we had to move it to the derectory where the user installs the program and only the pdf file(Result) would be stored in the "C:\Reports\" directory.
He who laughs last...
-- modified at 9:09 Tuesday 30th May, 2006
|
|
|
|
|
Is this the code? you didn't change anything in here except putting all I've written to you in a variable that probably shows you a warning "command is never used"...
put it in the Argument, it is still the last one that doesn't work.
|
|
|
|
|
the argument is your code. the command variable was my code but i've taken it out
it gives the same error: "'C:\Program' is not recognized as an internal or external command, operable program or batch file."
He who laughs last...
|
|
|
|
|
May I ask what is the /C?
|
|
|
|
|
the /c is the command line switch that lets command prompt know to run the command. That is how i understand it.
He who laughs last...
|
|
|
|
|
Well maybe try without it?
Maybe it's \c and not /c?
Check some stuff out...
Are you sure it's with a space after it? try also that.
-- modified at 9:24 Tuesday 30th May, 2006
|
|
|
|
|
thanks for your time and thanks for trying.
Enjoy your day
He who laughs last...
|
|
|
|
|
No problems... but does it work or not?
|
|
|
|
|
not yet but ill let you know as soon as i get it right. There is something id like to try. but im not prommising anything yet. hold your thums
He who laughs last...
|
|
|
|
|
i've got it Thank you soooooooo much. All we needed was one more "\"" in the beginning of the code it should look like this:
startInfo.Arguments = "/C" + "\"" + "\"" + @Convert.ToString(TempPath) + "\\fop.bat\" -xml \"" + @Convert.ToString(TempPath) + "\\ClientRecordCard.xml\" -xsl \"" + @Convert.ToString(TempPath) + "\\" + @Convert.ToString(TempName) + ".xsl\" -pdf \"" + @Convert.ToString(Salon.Library.GlobalVariables.Reports_Path) + "\\ClientRecordCard.pdf\"";
The Bold part is the extra i was talking about.
THANK YOU! i've been strugling with this since last week Monday. Now i can sleep soundly.
He who laughs last...
|
|
|
|
|
When trying to construct a long string like this, it's much easier to troubleshoot if you start with a single substring and add mroe one at a time after checking the last one works as intented, by printing ot the console.
|
|
|
|
|
thanks for taking the time to try and help me. i've found the problem.
He who laughs last...
|
|
|
|
|
Hey
So I have a XML with DataSet in it, in the DataSet I have 2 DataTables, in each DataTable I have a Unique ID, and I did to this row, auto-inc, and don't allow DBNull, and it's readonly.
So when I try to do NewRow(), and add it without setting the ID column, it throws an Exception DataColumn 'ID' can't allow DBNull.
So how can I do it as UNIQUE ID? do I need to allow DBNull?
Thanks in advanced...
NaNg.
|
|
|
|
|
Hi,
I have hundrets of applications in excel from which I get data from c# - it works.. but some people changed the original pattern of the excel file (for example they merged some cells).. What to do? Is there eny posobility to compary only cells addresses?
Please give me some code maybe - the case is extremally urgent and I didn't know that people would change these documents for their needs....
|
|
|
|
|
No ideas ?
|
|
|
|
|
if the problem is with the user changing the excel file, any remediation will have to be in excel. You probably need to reissue the SSes so that a password is needed to make that sort of change.
|
|
|
|
|
Eventually the only thing I can do is :
someRange.MergeCells.ToString() - it returns true if cells are merged...
I would have to check all cells in rows which have critical values and are merged in charasteristic way...
I can't reissue them... Client want to have an info that this and this dcument hasn't passed the structural qualification...
|
|
|
|
|
I have a windows form with a single textbox. I have a few event handlers for some form events. When the focus is set to the textbox, and the user hits the Esc key, focus should be set to the form. But this is not happening.
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if ((int)e.KeyChar == 27)
{
this.Focus();
}
}
No matter what I did, the focus did not move out of the textbox. How to set the focus back to the form again.?
Please help.
|
|
|
|
|
I'm pretty sure that if there is a control on a form that can receive the focus, the form itself cannot receive the focus. For instance, if the only control on the form is a label box, the FORM gets the focus since the label box cannot get the focus, but if there are any controls on the form that CAN get the focus, the form does not.
HTH
|
|
|
|
|
I have created a graphic object on a tabpage as follows:
Graphics g = null;
g = tabPage1.CreateGraphics();
g.DrawString(str_1, fnt, brsh, x, y);
g.Dispose();
str_1 has been displayed successfully. But how do I clear the existing text and display another text on the tabpage (tabpage.Controls.Clear() didn't work)?
At the moment, the problem is that the new text is displayed on top of the existing ones.
|
|
|
|
|
You must draw the existing string using background color to clear it.
|
|
|
|