|
There is an article,
http://www.codeproject.com/vb/net/Wordyna.asp
which is very useful, and I am very happily exporting web pages to word documents, with a little help from
TextWriter textWriter = new StringWriter();
Server.Execute("something.aspx", textWriter);
Response.Output.Write(textWriter.ToString());
as well, where I can excute any aspx and get the resulting output, do anything i want with it, and redirect to a word doc.
Does anyone know how to save this stream to a PDF, without getting a third party control, or using crystal reports?
Thanks
|
|
|
|
|
Nimendra pet wrote:
Does anyone know how to save this stream to a PDF, without getting a third party control, or using crystal reports?
Get a third party control. Unless you want to go through the hassle of writing your own .PDF generator... Do you know anything about the format of a PDF file?
The easiest way to do it to search the web for a free PDF Printer driver. Then all you do is print to that "printer" and it will generate the .PDF file for you.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks. the PDF generator looks real good, the next question would be, how would I bundle it with the MSI i create to distribute the web application... it won't be very helpful if I have to distribute it seperately. thanks again, the alientools PDF Generator is pretty good.
|
|
|
|
|
You'll have to get with the author(s) for any licensing permissions and distribution issues.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hello i am using a listview and it is set for detail view however i want to be able to store an a different object in each item. how do i store an item in a listview item such as using ItemData in MFC thanks for any help
|
|
|
|
|
use "Tag" of ListViewItem
|
|
|
|
|
Where to put some(about 300) certain strings(the list exists forever and I am not going to insert or remove any string) to find out quickly if a new string is among them?
SortedList, ArrayList, Stack, switch() or something else?
|
|
|
|
|
If you want almost constant lookup time (O(1)), use a hashtable. I think that a switch also uses a hash table, I'm not sure though. A Stack is a bad option, a SortedList works faster than an ArrayList, since you add items to the list only once.
Regards
Senthil
|
|
|
|
|
Hi,
I am new to this forum. I need to design and code a customized task manager, similar to the windows task manager. My GUI will receive the messages externally via MQ's. I need starting points in what controls I need to design the GUI similar to Windows Task Manager having tab controls and grids on the GUI. Any links where I can find samples of such projects. I tried to looking on google and msn but found almost nothing that points me in the right direction. Also I need to restrict access to the application via a logon screen. Any help is greatly appreciated.
- Thanks,
Sunny
|
|
|
|
|
Hello,
My problem is that I need to terminate some threads but I know only their Ids (Thread.Id)
So ..... do not you know how "dangerous" is calling WinAPI TerminateThread in .NET? or does exist better way to do that ?
Wizard_01
|
|
|
|
|
I don't see an Id property on System.Threading.Thread? Also, be warned that CLR threads don't translate to Windows threads on a one-to-one basis.
You can abort a .NET thread by calling the Abort method. That's not the recommended way though..
Regards
Senthil
|
|
|
|
|
S. Senthil Kumar wrote:
You can abort a .NET thread by calling the Abort method. That's not the recommended way though..
What is the recommended way?
/\ |_ E X E GG
|
|
|
|
|
The recommended way is to use some sort of a signaling mechanism and just return from the method.
Regards
Senthil
|
|
|
|
|
OH, and since the thread has nothing to do, it would just be collected by GC?
/\ |_ E X E GG
|
|
|
|
|
Sorry, It was ProcessThread. But Abort method is on Threading.Thread. I cannot have the collection of user-defined threads, or can I ?
Wizard_01
|
|
|
|
|
Why would an app run on the same exact dataset on a PC with 512MB of RAM eat up 300MB of memory but when run on a PC with 1024MB of Ram only use 44MB at peak?
|
|
|
|
|
If you're judging by the "Mem Usage" column in the task manager, you're looking in the wrong place for memory usage; that column takes into account Windows memory paging, which will vary depending on the amount of RAM in the system.
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
Hi you all
I am programming a little chat-program. In order to work with the source code of the chat-text I try to get into a string - the action causes my program to get very slow the mous comes over the webbrowser. Here's the code:
private void docucTimer_Tick(object sender, EventArgs e)
{
DocumentText = chatBox1.DocumentText;
if(curText.Length != DocumentText.Length)
{
docText = DocumentText;
try
{
docText = docText.Substring(curText.Length);
}
catch
{
}
curText = DocumentText;
chatBox1_OnDocumentTextChanged();
}
}
The first line, DocumentText = chatBox1.DocumentText;, is the problem.
If the mouse comes over the webbrowser in the program, my CPU-Usage goes up to a 100 %. This happens after at about 5 minutes of program-runtime.
If I disable the code shown upper from the beginning on, the problem does not appear, but - and thats really strange - if I disable the code after I first recognized the problem it will still exist and there's no way to get the old state excerpt of restarting the software...
Is there a way to solve the problem?
I am a noob, I am sorry for that - and also for my not-being-able to speak English :P
And thank you for your help!
|
|
|
|
|
One possible cause of the problem is that if you are constantly calling .Substring (which allocates a new string on the heap), the garbage collector will eventually kick in and have to clean up some unused memory, which might be what you're seeing.
How often does the docucTimer occur? If its less than every 1000 millisecods, you may be doing too many allocations via Substring.
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
The Interval of the docucTimer is set to 1000 milliseconds.
Well, I think in the beginning I did not even work with substring, I though this method would be more efficient and tried to solve the problem this way. You know it didn't work.
I've now tried to run the program only with the first line, and the problem still occured. I looked like that: (Of course it didn't work correctly anymore, but the problem was still there)
private void docucTimer_Tick(object sender, EventArgs e)
{
DocumentText = chatBox1.DocumentText;
// if(curText.Length != DocumentText.Length)
// {
// docText = DocumentText;
// try
// {
// docText = docText.Substring(curText.Length);
// }
// catch
// {
// }
// curText = DocumentText;
// chatBox1_OnDocumentTextChanged();
// }
}
hm...
/Edit: If I also comment out the first line the problem is gone, so it is because of some other part of the program...
|
|
|
|
|
Hello!
I want to get the volume names of the disks on my computer. I found a nice way that you are supposed to be able to get it and this is the way:
<br />
SelectQuery sqlLogicalDrives = new SelectQuery("SELECT * FROM Win32_LogicalDisk");<br />
ManagementObjectSearcher moSearcher = new ManagementObjectSearcher(sqlLogicalDrives);<br />
ManagementObjectCollection mocLogicalDrives = moSearcher.Get();<br />
<br />
foreach (ManagementObject moDrive in mocLogicalDrives)<br />
{<br />
cmbExplorerRootFolder.Items.Add(moDrive.Properties["VolumeName"].Value.ToString());<br />
}<br />
but for some reaseon I get the error message: An unhandled exception of type 'System.NullReferenceException' occurred in MyProject.exe
Anyone who can tell me what I'm doing wrong?
Thanks in advance!
~~~~~~~~~~~~~~
Martin Lundberg
Student, Sweden
I have to thank every member of the Code Project for making it such a great place for a beginner to learn!
|
|
|
|
|
Either the value returned by Properties["VolumeName"] or .Value is null. You need to do some simple checks from unknown sources beforing calling methods or accessing properties on an instance:
foreach (...)
{
PropertyData data = moDrive.Properties["VolumeName"];
if (data != null)
{
object value = data.Value;
if (value != null)
cmbExplorerRootFolder.Items.Add(value.ToString());
}
} You can actually simplify this code, however, using the indexer for the ManagementObject class that gets the value or a property as its proper type:
foreach (...)
{
string value = moDrive["VolumeName"] as string;
if (value != null)
cmbExplorerRootFolder.Items.Add(value);
}
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hello again!
Now the error is not showed (thanks! =)) but, nothing is added to the combobox =/. When the application starts I can hear a: (the floppy drive) but it is not added to the combobox and neither is anything else =/
~~~~~~~~~~~~~~
Martin Lundberg
Student, Sweden
I have to thank every member of the Code Project for making it such a great place for a beginner to learn!
|
|
|
|
|
Found out why, I had not named my disks, but still in Explorer they look like: Local Disk (C , Local Disk (D , etc.
Should I get what kind of disk it is, and then if volume is empty add like Local disk, myself or is local disk something else then "VolumeName"? =)
Thanks in advance!
~~~~~~~~~~~~~~
Martin Lundberg
Student, Sweden
I have to thank every member of the Code Project for making it such a great place for a beginner to learn!
|
|
|
|
|
You'd best get the drive letter and optionally get the name. What you see by default in Explorer is the drive type.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|