|
You should start by figuring out how you are going to convert this information into PDF format: using the iTextsharp library, a PDF printer driver, Web page, something else ... ?
|
|
|
|
|
There are more than 1 million records, thus it would be best if I can make a batch job for this.
Also for pdf format, crystal report will be feasible but the question is, if crystal report is feasible to take dynamic arguments and then will be able to export PDFs to the LAN location?
|
|
|
|
|
Listen to what the man said: don't start out with "oh I need a batch job", start with "how am I going to do the actual conversion?" and then work out how to automate that.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Member 11332969 wrote: I have to generate and store bulk(almost 1 Million) pdf reports from a database to a LAN location.
I seriously doubt that is a valid business requirement. Some one is confused.
Also is this supposed to be a one time effort? So three years from now exactly the same 'report' will still be valid?
But as noted else where start with creating one report just so you can measure how many resources it takes to generate it. Not to mention what resources you have available to create the report. But based solely on the requirements that you specified I would create an application that would do the following
1 Take input parameters that specified the 'range' of what should be create
2 Process that range sequentially and after each 'report' was generated create a entry in file to indicate it was complete.
3 Then 'send' the file to the 'lan' (whatever that means), Then make a different entry that it was successfully sent.
4 Repeat steps 2/3 till the entire 'range' is spanned.
Writing to the file above allows you to track that everything was done. It also allows you the option to restart if the app fails without redoing all of the work.
In terms of the specific technology necessary to create the report that depends on the content of the report. Crystal is ok but one can get by with other tools if necessary.
|
|
|
|
|
I have create windows application. I have a requirement of continuous stationary printing in vb.
|
|
|
|
|
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
OriginalGriff wrote: Use the "Improve question" widget Good luck to him trying to find it.
|
|
|
|
|
Well, he should post in the right forum then!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I have a area in my Project where i need to display a title and content in two text boxes. The Data base tables are:
ID | Title | Content
This is what I have so far, I know I am on the right track, I just cant figure out how to get each box to display based on the ID.
[CODE]
private void frmMain_Load(object sender, EventArgs e)
{
try
{
string connStr = ConfigurationManager.ConnectionStrings["sdcAssistDB"].ConnectionString;
OleDbConnection dbConn = new OleDbConnection(connStr);
dbConn.Open();
OleDbCommand dbCommand = new OleDbCommand();
dbCommand.Connection = dbConn;
string query = "select * from JobAid";
dbCommand.CommandText = query;
OleDbDataReader dbReader = dbCommand.ExecuteReader();
while (dbReader.Read())
{
txtTitle1.Text = (dbReader["Title"].ToString());
txtContent1.Text = (dbReader["Content"].ToString());
txtTitle2.Text = (dbReader["Title"].ToString());
txtContent2.Text = (dbReader["Content"].ToString());
}
dbConn.Close();
}
catch (Exception ex)
{
MessageBox.Show("Unable to Connect to Database" + Environment.NewLine + "SDC Assistant will now Close " +ex,
"Critical Database Error!",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
Application.Exit();
}
}
[/CODE]
Thank you in advance
Rab
|
|
|
|
|
Um.
You do realise that the loop
while (dbReader.Read())
{
txtTitle1.Text = (dbReader["Title"].ToString());
txtContent1.Text = (dbReader["Content"].ToString());
txtTitle2.Text = (dbReader["Title"].ToString());
txtContent2.Text = (dbReader["Content"].ToString());
} will always leave the final row's worth in the text boxes, regardless of how many you return from SQL? I'd suggest replacing the while with if
And to make it do what you want, change this:
string query = "select * from JobAid";
dbCommand.CommandText = query;
To this:
string query = "SELECT * FROM JobAid WHERE Id=@ID";
dbCommand.CommandText = query;
dbCommand.Parameters.AddWithValue("@ID", yourIdValueToLookFor);
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I am writing a c# dll to Revit. I use the Util static class in the code ex.
Util.PluralSuffix(n)
but it seems that Util is not known to the visual c#.
What is I am missing?
brgrds
|
|
|
|
|
Hi brgrds,
The bit that is missing is the ability to understand the section at the top of this forum, i.e. the rules for the lounge.
They may help you in your quest for world dominance.
|
|
|
|
|
You're missing the right place to post the question.
Try here[^] for more specific answers or here[^] if you want more of a discussion.
Wrong is evil and must be defeated. - Jeff Ello
(√-sh*t) 2
|
|
|
|
|
Member 8902328 wrote: I use the Util static class in the code ex. What Util class?
Member 8902328 wrote: but it seems that Util is not known to the visual c#. Because there is no class with that name. It is either from Revit, or a custom class. Is it one from 'The Building Coder'[^]?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Probably, you need to add a reference to the assembly to your project:
Open the Project branch in the Solution Explorer pane.
Right click "References" and select "Add Reference..." from the menu that appears.
Click the "Browse..." button in the lower right of the dialog that appears and navigate to the DLL file containing the Util class.
Highlight the DLL file, and press "Open".
Click the "Add" button.
Click the "Close" button
You may also need to add a using line to the top of your .CS file to add the namespace to your code.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Datagridview is harder than I anticipated. I would like to click on my column header and select an entire column to change it, or click on my row header and select an entire row to change it, or select multiple cells to change them or a single cell to change it.
Is this possible with the datagridview object? If so, does anyone have a code example? I've been looking over the net and I'm able to get the column selection to work most of the time, but apparently that disables row selection and I would like both of them, depending on which header is clicked?
Thanks for reading.
modified 22-Dec-14 14:56pm.
|
|
|
|
|
|
I think your requirements sound a little ambitious for the DGV, it sounds like you are more after spreadsheet like functionality which you will not get out of a DGV. You might have to look into some of the spreadsheet controls, none of which are free or even cheap.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Is there any way to select a cell and then if the enter key is pressed, have an input box pop up to input a value. Then taking it further, select multiple cells, press the enter key, input box pops up and you can set that same value for all selected cells? Is this possible in the datagridview object?
|
|
|
|
|
If you had followed my earlier suggestion and looked at the properties in the documentation, you would have spotted MultiSelect[^].
|
|
|
|
|
I did follow your suggestion. That doesn't mean it gives a working code example that I can insert into my form and start to figure out its intricacies.
I can't even get the event handlers to work with this object, it tells me the following error for the following code?
Error 4 Cannot implicitly convert type 'System.Windows.Forms.DataGridViewCellEventHandler' to 'System.EventHandler' c:\Form1.cs 51 47
this.dataGridView1.CellClick += new DataGridViewCellEventHandler(dataGridView1_CellClick); // works
this.dataGridView1.DoubleClick += new DataGridViewCellEventHandler(dataGridView1_CellDoubleClick); // generates the above error
|
|
|
|
|
DataGridView does not have a DoubleClick event, it is inherited from Control. You should be using CellDoubleClick or use the approprite casting for double clicking of the entire form.
|
|
|
|
|
Thank you, celldoubleclick worked.
With multiselect, that appears to just be a property that you enable or disable. If enabled, how can I know which cells I've selected? Then I could input the data for the select cells with a right click command possibly?
|
|
|
|
|
turbosupramk3 wrote: how can I know which cells I've selected? Once again, go and look at the documentation, see what information you get presented with by the different events.
|
|
|
|
|
Hello guys!
How to save text from multiline TextBox2 as (.txt) UTF-16 (Unicode), and not as UTF-8.
This is my code that is not good:
saveFileDialog1.Filter = "Text files (*.txt)|*.txt|All files (*.*)|*.*";
saveFileDialog1.FileName = String.Empty;
saveFileDialog1.DefaultExt = ".txt";
DialogResult result = saveFileDialog1.ShowDialog();
if (result == DialogResult.OK)
{
byte[] contents;
System.Text.Encoding ascii = Encoding.Unicode;
contents = ascii.GetBytes(textBox2.Text);
using (Stream fs = (Stream)saveFileDialog1.OpenFile())
{
fs.Write(contents, 0, contents.Length);
fs.Close();
MessageBox.Show("File successfully saved!");
}
}
I need a better solution. Thank you!
modified 22-Dec-14 4:22am.
|
|
|
|