Page 1 of 1

Problem with a Report.

Posted: Wed Jun 25, 2008 8:20 am
by EDV Gradl
Hi there!
I have a little strange problem.
Situation: We have a global-bill which is derived in any bill-report. We have bills for "normal" custormers and have have a bill for one-time customers. One-time Customers get their adress-data saved in another SQL-table then "normal" customers.
In the global-bill is the Billheader with the adress-field. This field filled with the GetValue-event and this field contains following code:

Code: Select all

StringBuilder MyText = new StringBuilder();
if (this.PersonID != 0)
{
  MyText.AppendLine(ToString(Person.Vorname) + " " + ToString(Person.Name));
  if (ToString(Person.Zimmer) != "---")
    MyText.AppendLine("Zimmer: " + ToString(Person.Zimmer));
  MyText.AppendLine(ToString(Adresse.Strasse));
  MyText.AppendLine();
  MyText.AppendLine(ToString(Adresse.PLZ) + " " + ToString(Adresse.Ort));
}
else
{
  if (Stammdaten.EinmalKunde)
  {
	if (!String.IsNullOrEmpty(ToString(EinmalAdresse.Zeile1)))
      MyText.AppendLine(ToString(EinmalAdresse.Zeile1));
    if (!String.IsNullOrEmpty(ToString(EinmalAdresse.Zeile2)))
      MyText.AppendLine(ToString(EinmalAdresse.Zeile2));
    if (!String.IsNullOrEmpty(ToString(EinmalAdresse.Zeile3)))
      MyText.AppendLine(ToString(EinmalAdresse.Zeile3));
    if (!String.IsNullOrEmpty(ToString(EinmalAdresse.Zeile4)))
      MyText.AppendLine(ToString(EinmalAdresse.Zeile4));

	MyText.AppendLine(ToString(EinmalAdresse.Strasse));
    MyText.AppendLine();
    MyText.AppendLine(ToString(EinmalAdresse.PLZ) + " " + ToString(EinmalAdresse.Ort));
  }
  else
  {
    if (!String.IsNullOrEmpty(ToString(Adresse.Zeile1)))
      MyText.AppendLine(ToString(Adresse.Zeile1));
    if (!String.IsNullOrEmpty(ToString(Adresse.Zeile2)))
      MyText.AppendLine(ToString(Adresse.Zeile2));
    if (!String.IsNullOrEmpty(ToString(Adresse.Zeile3)))
      MyText.AppendLine(ToString(Adresse.Zeile3));
    if (!String.IsNullOrEmpty(ToString(Adresse.Zeile4)))
      MyText.AppendLine(ToString(Adresse.Zeile4));
    
    MyText.AppendLine(ToString(Adresse.Strasse));
    MyText.AppendLine();
    MyText.AppendLine(ToString(Adresse.PLZ) + " " + ToString(Adresse.Ort));
  }
}
e.Value = MyText.ToString();
the line "if (Stammdaten.EinmalKunde)" is true when we have an one-time customer.

Now my problem:
When i print the Bill as an one-time-customer bill, there is no adress attached. The data are correct in the database and when i'm not using the GetValue-event i get the adressdata attached, but i need it in the GetValue event.

What has gone wrong here?

Thanks,
Jens, EDV Gradl

Problem with a Report.

Posted: Thu Jun 26, 2008 6:30 am
by Edward
Hello, Jens.

Please add the following commands:

MessageBox.Show("Branch1")
MessageBox.Show("Branch2")
MessageBox.Show("Branch3")

to each 'if - else' statement and please take a look which statement would executed.

Also please try to define PersonID variable in the Dictionary.

It is really difficult to suggest something else.

Please send a report template to support[at]stimulsoft.com for analysis if it wouldn't help.

Thank you.