|
Turn off the event while saving in your app.
|
|
|
|
|
Good day
I have created two reports one that shows debits (which works 100%), and one that shows debits against credits per day. It shows total debits and total credits per day, ie one line per day. In the SQL database I have a table for debits and another for credits. There are also various rates on each table. Debits and Credits can be bought and sold on a regular basis. In the reports we reflect the weighted averages of the days transactions
SUM(rate * (bought - sold) / SUM(bought - sold)).
In the Debits report, I use the Debits dataset with the individual transactions as they appear in the DB. This approach works 100%. In the DebitsCredits report, I have created a View that combines the values from the two tables. Forcing me to join them per day (ie. getting totals per day, I lose the individual records). This approach gives me different results to the Debits report, wrong results, due to the fact that individual transactions "have beeen lost".
I thought of making use of the two individual tables, but cannot assign both datasets to the same RDLC table ReportItem. I also need to perform calculations between the two datasets (ie. creditamount - debitamount = balance).
Which other way can I bring the individual records of both table into the report and perform calculatins between them?
Many thanx.
Hennie
------------
"It's not the blowing of the wind that determines your destination, it's the set of the sail." - Jim Rohn.
|
|
|
|
|
Hi all, I'm currently using C# and Windows Mobile 6. I've succeeded in exporting data from the datagrid to the selected directories in the mobile. However, when I access the file, an error messaged popped out, "There is no application associated with "file" run the application first, then open this file from within the application." And one more thing, when I send the file to my email address, I can read the contents from the file. Why can't I read the file contents from the mobile? The code below is my code snippet. Please take a look, any help would be appreciated. Thanks in advance. =)
private void btnExport_Click(object sender, EventArgs e)
{
SqlCeDataReader reader;
SqlCeConnection conn = new SqlCeConnection(connStr);
conn.Open();
SqlCeCommand cmd = new SqlCeCommand("SELECT No, DateAndTime, LocationInformation FROM Location", conn);
cmd.ExecuteNonQuery();
reader = cmd.ExecuteReader();
using (StreamWriter writer = new StreamWriter("\\Program Files\\file.csv", true))
{
try
{
while (reader.Read())
{
writer.Write(reader["No"]);
writer.Write("#");
writer.Write(reader["DateAndTime"]);
writer.Write("#");
writer.Write(reader["LocationInformation"]);
writer.WriteLine();
}
}
catch (Exception excp)
{
MessageBox.Show(excp.Message);
}
finally
{
reader.Close();
conn.Close();
}
}
MessageBox.Show("Data of table writtten into \\Program Files\\file.csv file", "Writing completed");
}
modified on Monday, February 1, 2010 4:34 AM
|
|
|
|
|
codenoobie wrote: "There is no application associated with "file" run the application first, then open this file from within the application."
This message seems quite clear; you have tried to open a file but the OS does not know which application to start to process the file. You need to set up an association between your app and the file type. This is done via Windows Explorer on a PC, I don't know the equivalent on a mobile system.
MVP 2010 - are they mad?
|
|
|
|
|
Thanks, I'm quite new to this. So I just have to know about file association right?
|
|
|
|
|
Well, I would suggest you learn about the platform you want your program to operate on, before trying to write any code.
MVP 2010 - are they mad?
|
|
|
|
|
I've found out that the pocket excel actually couldn't read files in csv or xls format, so I just have to save the file into txt format. Thereafter, the file can be read.
|
|
|
|
|
Hello,
I have a function say
<br />
public void GetMeString(out string myStr)<br />
{<br />
myStr = "ABC";<br />
}<br />
This function resides in a C# library and the class for this function is COM visible. Can you please let me know how do I call the function in VB and get the value.
I tried:
Dim var as MyClass
Set var = New MyClass
Dim str As String
var.GetMeString(str)
But str is always empty...
|
|
|
|
|
Q2A wrote: var.GetMeString(str)
I don't know VB but in C# I think that should be var.GetMeString(out str);
MVP 2010 - are they mad?
|
|
|
|
|
|
Of course; perhaps you could explain to the OP what he/she needs to do?
thanks.
MVP 2010 - are they mad?
|
|
|
|
|
var.GetMeString(byref str)
|
|
|
|
|
No, I asked you to post this to the OP; I don't really care about it.
MVP 2010 - are they mad?
|
|
|
|
|
|
Thomas Krojer wrote: I´m sure he read it
Experience suggests I'm just as sure he didn't.
MVP 2010 - are they mad?
|
|
|
|
|
I want to fill a treeview with rows of a datatable that have already been stored in a database. I used a code like this:(Obj is the returned row)
(the root node have been specified before and I want to put just the child nodes)
foreach (TreeNode tn in treeView1.Nodes)
{
if (tn.Text == Obj[8].ToString())
{
TreeNode NewNode = new TreeNode();
NewNode.Name = Obj[0].ToString();
NewNode.Text = Obj[10].ToString();
tn.Nodes.Add(NewNode);
treeView1.SelectedNode = NewNode;
treeView1.SelectedNode.Expand();
}
}
But only one child is added to the treeview and after that it seems that the number of nodes of the tree do not change (update) and still remains 1. How should I update the treeview after a node added to it?
Thanks so Much In Advance!
Good Luck!
|
|
|
|
|
|
hi,
Comparation of the two strings is wrong:
if (tn.Text == Obj[8].ToString())
Correct:
if (tn.Text.CompareTo(Obj[8].ToString()) == 0)
Cheer's,
Alex Manolescu
|
|
|
|
|
Sorry to say it so, but I don't know what this answer should help.
Both functions determine the same result.
And also both crash if Obj is null.
And finally here so funny text from MSDN:
"Caution:
The CompareTo method was designed primarily for use in sorting or alphabetizing operations. It should not be used when the primary purpose of the method call is to determine whether two strings are equivalent. To determine whether two strings are equivalent, call the Equals method."
Sorry for the "downvoting", but your answer is simply wrong.
Greetings
Covean
|
|
|
|
|
Dear mate,
until this i taught the Equals method compare objects instances and the CompareTo method compare values.
I've search a little more and see that the Equals method for String is overriden to compare values.
In objects case the Equals method compare instances..
However the result is the same if you use CompareTo or Equals , so thanks for the tip!
Every day you learn something!
Cheer's,
Alex Manolescu
|
|
|
|
|
Hello Everybody........!
I've one problem. Please Help.
I have developed my project in VS2008. Noe it is to the final stage of completion. My All Crystal Reports are running properly.
The Only Problem I've is I need to run two crystal reports using single CrystalReportViewer.
So Please Tell me is it possible? If yes, How?
Thanks & Regards
Pankaj Patil
.
|
|
|
|
|
Hi Pankaj,
Using subreports you can do this.
1. You have alredy 2 reports like Test1.rpt and Test2.rpt OK.
2. Take onother Blank report like Main.rpt, [attach Test1.rpt SP or any], devide the details section like Details a & Details b --> for deviding detail section right click on Main.rpt -> select Sectiopn Extert -> select Details -> click on insert button
3.Then Click on sub report on top menu of the Main.rpt report --> Insert Subreport window is displaying -> select subreport tab -> choose existing report [Test1.rpt]with help of browse button - > Then select the Link tab -> set the parameter -> Click OK
4. one link is attached with cursor place it in Main.rpt Details a section
5. then repeate the step 3 for attaching Test2.rpt file -> place it in Details b section of the Main.rpt
6. In u r application cal the Main.rpt file instead of Test1.rpt
7. for allignment do some changes using Format Subreport [Righ click & select]
Thanks,
Basu Malipatil
|
|
|
|
|
Hi,
Anybody can help me to solve this problem.
I trying to open a powerpoint file(for preview) in my application using AxFramerControl.
axFramerControl1.Open(fileName, true, "PowerPoint.Show", null, null);
.....
.....
axFramerControl1.Close();
It is opening the file in my application, but after closing the file i am trying to delete the file.
File.Delete(filename);
In this case i am getting an error "Cannot delete access denied". i think it is problem with axFramerControl1.Close(), it is not closing the application properly. Can anybody tell me how to close the Framercontrol correctly to delete the file.
thanks in advance
Jafar K
|
|
|
|
|
Hi, I've recently started using Windows forms and need to create many threads which loop through a given CSV and process the contents to a method. I'm not sure of the best way of doing this. I can create a few threads but each thread processes each line rather than 1 line being processed by one thread and the next line being processed by another thread. The first value is a unique identifier if that helps.
Hope I've explained it ok, can anybody please advise?
Thanks
|
|
|
|
|
I would expect that one thread should read the file and place each line in a Queue. Then several other threads can read from the Queue and proceed from there.
|
|
|
|