|
i have imported library for pdf creation
using iTextSharp.text;
using iTextSharp.text.pdf;
using iTextSharp.text.html;
using iTextSharp.text.html.simpleparser;
using System.Text;
i am also getting gridview records in pdf.
my problem is i need 10 rows per page. So next 10 record(11 to 20) should be displayed with header name in next page of pdf.
|
|
|
|
|
AlexRusso wrote: my problem is i need 10 rows per page. So next 10 record(11 to 20) should be displayed with header name in next page of pdf.
Fetch all records, and write them in groups of 10 to the page. You might get better help if you include the code that's causing the problem.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hello friends. my question is very short. I only used one filesystemwather and nothing else. And used its created method. But when i send a file into the folder, it throws this error:"Exception has been thrown by the target of an invocation." on this line: Application.Run(new Form1()); Do you know why?
|
|
|
|
|
the exception is not really on that line. its somewhere inside the Form1 class. can you post the complete exception stack ? try to debug your application step by step you can able to track down this error.
|
|
|
|
|
Yes you are right. This is what i found in intellitrace:
Exception:Thrown: "The process cannot access the file 'd:\deneme\OCTOPUSxml-66907571 - Copy.xml' because it is being used by another process." (System.IO.IOException)
A System.IO.IOException was thrown: "The process cannot access the file 'd:\deneme\OCTOPUSxml-66907571 - Copy.xml' because it is being used by another process."
Exception:Thrown: "Exception has been thrown by the target of an invocation." (System.Reflection.TargetInvocationException)
A System.Reflection.TargetInvocationException was thrown: "Exception has been thrown by the target of an invocation."
In created method of filewatcher, i have these codes:
XmlDocument xdc = new XmlDocument();
xdc.Load(e.FullPath);
Somehow, grasping the file by filewatcher and loading by xmldocument occur almost at the same time. To be sure i changed the code as :
XmlDocument xdc = new XmlDocument();
System.Threading.Thread.Sleep(1000);
xdc.Load(e.FullPath);
System.Threading.Thread.Sleep(1000);
I know this is not professional but now it is working
|
|
|
|
|
Sleep is not the right choice. can you paste the code on how you initialize the file watcher instance. I guess its FileCreated event you are watching,while other application create and manage the file you are trying to load this in your form.
|
|
|
|
|
FileSystemWatcher doesn't "grab" files. It doesn't touch them at all.
The file is either being held open by your process using some other method, or some other process has the file open and locked, like something that outputs the file?? Or some editor??
|
|
|
|
|
leone wrote: Do you know why?
..because of an unhandled error in a constructor, probably the one from Form1 . Paste your code and we'll have a look.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
In a C# 2008 desktop application, the application is having a problem
determining if a folder exists on a network drive.
I am using code that looks like the following:
using System.IO
if (!File.Exists(myfile))
Console.WriteLine("The file does not exists.");
The value for the directory comes from a column in the database that
looks like the following:
//servername/mdain/myfile.xls".
Thus can you tell me what I can do so this application is aware that the file does exist on the network drive?
|
|
|
|
|
The first thing I see is that your sample path you provided is wrong. You are using the wrong slash in the path, it should be "\\servername\mdain\myfile.xls". The second thing I would check is if the computer you are running the application on has permissions to access the network drive, since that would return false regardless of the file existing.
|
|
|
|
|
Forward slashes are fine in path names; Windows correctly interprets them.
Use the best guess
|
|
|
|
|
Richard MacCutchan wrote: Forward slashes are fine in path names; Windows correctly interprets them.
Windows, yes. Most apps do not.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: Most apps do not. Well, you would not expect Microsoft's apps to do things properly, would you?
Use the best guess
|
|
|
|
|
Richard MacCutchan wrote: Well, you would not expect Microsoft's apps to do things properly, would you?
If I wouldn't, I'd be recommending to use GNU/C, OpenOffice, MySql and black magic.
Still I recommend to pay up for Microsofts' apps
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I'm not sure how easy that would be but perhaps the DirectoryInfo [^] or FileInfo [^] classes would help.
Use the best guess
|
|
|
|
|
|
I'm developing WCF silverlight application in C#.net 2010.
My question is simple, i'm getting WPF child window form name from database.
now i want to open that Child Window form using name/string coming from database. How to convert that string value into Child Window or do you have any other best solution solve for this. please help me thanks for you all
|
|
|
|
|
I think you would need to use Reflection[^].
Use the best guess
|
|
|
|
|
You're trying to open a WPF window in a Silverlight application using WCF to retrieve the WPF window? Good luck.
|
|
|
|
|
How funny, I was thinking exactly the same thing in more or less the same way even.
|
|
|
|
|
Now you're being obtuse, you know he is trying to get the name of the window from the database, opening a WPF window in silverlight is going to be a challenge I'll admit!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
msbuild and Visual studio seem to resolve project dependencies differently: a solution file contains the project for the main executable, and some projects for dlls the executable depends on. One of these dll projects depends on another project which is not part of the solution.
Just to show the major players in this case, and a simple way to reproduce it:
solution contains ExeProject and MainDllProject , MainDllProject depends on SubDllProject which is not part of the solution (but in the same hierarchy on the file system). ExeProject depends on MainDllProjectClass1 of MainDllProject (that class does not depend on SubDllProject ; only MainDllProjectClass2 depends on SubDllProject , but it is not used by ExeProject nor MainDllProjectClass1 ):
Solution
ExeProject
Form1 (depends on MainDllProject.MainDllProjectClass1)
MainDllProject
MainDllProjectClass1
MainDllProjectClass2 (depends on SubDllProject.SubDllProjectClass)
Not part of the solution
SubDllProject
SubDllProjectClass
When the solution is built with Visual Studio 2010, it fails: MainDllProject cannot be built because SubDllProject cannot be found.
When the solution is built with msbuild, the build succeeds. Strangely, the debug version of SubDllProject is built despite the parameter /p:Configuration=Release.
The log file for msbuild is some 374 kB, do you have some hints how to analyse it? I want to understand why it builds SubDllProject at all, why it is the debug version, and evetually how to prevent it from being built when not referenced (I want the the solution to contain all referenced projects, and when a dependency was forgotten, I want to see an error message).
Note: this case is similar to http://stackoverflow.com/questions/12836023/visual-studio-build-non-dependent-projects-in-solution[^], but quite the other way round...
I understand from http://blogs.msdn.com/b/visualstudio/archive/2010/12/21/incorrect-solution-build-ordering-when-using-msbuild-exe.aspx[^] that msbuild translates the sln file into its own format - but the sln.metaproj file does not show any reference to SubDllProject either.
|
|
|
|
|
You might have better luck asking in this[^] forum.
|
|
|
|
|
Hey CP,
Getting text from one form to another is no problem. But I am having issues showing data from a ComboBox from form1 to display as text in form 2. Alright let's jump right into my example.
string instText = comboInst.GetItemText(comboInst.SelectedItem);
string folder = instText.Substring(0, 4);
comboInst is a combo box that has a list of items that is pulled from a directory. All items have a leading 4 digits that I use a lot in form1. But I can't get those 4 values for the life of me to show even in a messagebox on form 2. It just shows blank when using methods that pull information from a textBox.Text.
I need to be able to use both instText and folder strings in other forms.
Anyone got any ideas? The example I used is located on stackOverflow:
[^]
Thanks!
|
|
|
|
|
If you want to get the selected Item value, you can directly get the selected value using the combo.SelectedItem propety.
but thats not the problem here for you.
did you check the contents of instText has the data you selected? have you tried to debug this?
what is the content of instText?? moreover in which method you call these lines?
|
|
|
|