Ignore warning on duplicate on duplicate definition

Stimulsoft Reports.NET discussion
Post Reply
User avatar
dmasterplan
Posts: 143
Joined: Thu Mar 17, 2022 4:04 am
Location: Philippines

Ignore warning on duplicate on duplicate definition

Post by dmasterplan »

Hi,

How do I ignore error for dupllicate definition?
Shown below, there are two (2) definition for Responsible Person.


public virtual string Responsible_Person
{
get
{
return ((string)(StiReport.ChangeType(this["Responsible Person"], typeof(string), true)));
}
}

public virtual string Package_In_Charge
{
get
{
return ((string)(StiReport.ChangeType(this["Package-In-Charge"], typeof(string), true)));
}
}

public virtual string Responsible_Person
{
get
{
return ((string)(StiReport.ChangeType(this["Responsible Person"], typeof(string), true)));
}
}

I have a purpose for it as this is my query for the datasource
SELECT
Name,
projectno,
BEName,
package,
Code,
description,
PackageCategory,
status,
tenderlettingdate,
tendercalldate,
acttendcalldate,
acttendletdate,
Discipline,
[Responsible Person],
CASE
WHEN MainQuery.[Package-In-Charge] <> ''
THEN LEFT(MainQuery.[Package-In-Charge], CAST((LEN(MainQuery.[Package-In-Charge]) - 1) AS INT))
ELSE
''
END 'Package-In-Charge',
MainQuery.[Responsible Person]
FROM
(
SELECT
Cmdiscipline.code "Discipline",
ISNULL(
SUBSTRING(
(
SELECT DISTINCT
CONCAT(
ISNULL(
CAST(CONCAT(contact.Name, ', ', Parent.RecipientCode + ', ') AS NVARCHAR(1000)),
''
), ''
) AS [text()]
FROM
contact
INNER JOIN
contact parent
ON parent.contact = contact.parentcontact
INNER JOIN
packagerole
ON PackageRole.contact = contact.contact
WHERE
1 = 1
AND packagerole.Package = package.package
FOR XML PATH('')
), 1, 1000
), ''
) 'Package-In-Charge',
(
SELECT
CONCAT(Contact.Name, ', ', Parent.RecipientCode)
FROM
contact
INNER JOIN
contact Parent
ON Parent.contact = contact.parentContact
INNER JOIN
package p
ON p.ResponsiblePerson = contact.contact
WHERE
p.package = package.package
) "Responsible Person"
FROM
Project
INNER JOIN
Package
ON Project.Project = Package.Project
INNER JOIN
BusEnt
ON Project.BusEnt = BusEnt.BusEnt
LEFT JOIN
cmdiscipline
ON Cmdiscipline.Cmdiscipline = Package.Cmdiscipline
WHERE
Project.Project = 104
AND BusEnt.BusEnt = 7
AND (
Package.packagecategory = 0
OR 0 = 0
)
) MainQuery


I have read an article regarding supressing warning

class Test
{
int unused;
int assigned = 3;
}

warning CS0169: The field 'Test.unused' is never used
warning CS0414: The field 'Test.assigned' is assigned but its value is never used

It was suppressed like this:
class Test
{
#pragma warning disable 169, 414
int unused;
int assigned = 3;
}

and re-enabled like this:
class Test
{
#pragma warning disable 169, 414
int unused;
int assigned = 3;
#pragma warning restore 169, 414
}


I am not sure if this is possible or not AND it didn't give a code for the error or warning.

How can this be solved?


Regards,

Leeyo
Lech Kulikowski
Posts: 7338
Joined: Tue Mar 20, 2018 5:34 am

Re: Ignore warning on duplicate on duplicate definition

Post by Lech Kulikowski »

Hello,

Please send us a sample that reproduces the issue for analysis.

Thank you.
ulli82
Posts: 47
Joined: Tue Jul 06, 2021 6:46 am

Re: Ignore warning on duplicate on duplicate definition

Post by ulli82 »

Your Sql Query returned two columns with name 'Responsible Person'.
User avatar
dmasterplan
Posts: 143
Joined: Thu Mar 17, 2022 4:04 am
Location: Philippines

Re: Ignore warning on duplicate on duplicate definition

Post by dmasterplan »

ulli82 wrote: Wed Mar 30, 2022 1:44 pm Your Sql Query returned two columns with name 'Responsible Person'.
yeah, it does. that's how it should be. My question is how to ignore it. :)
User avatar
dmasterplan
Posts: 143
Joined: Thu Mar 17, 2022 4:04 am
Location: Philippines

Re: Ignore warning on duplicate on duplicate definition

Post by dmasterplan »

Lech Kulikowski wrote: Wed Mar 30, 2022 9:42 am Hello,

Please send us a sample that reproduces the issue for analysis.

Thank you.
should I send the mrt? I can't send the db as it is a company property. how to convert (table) it to xml anyway?
and how do I send it? where?
ulli82
Posts: 47
Joined: Tue Jul 06, 2021 6:46 am

Re: Ignore warning on duplicate on duplicate definition

Post by ulli82 »

Column names have to be unique.
Lech Kulikowski
Posts: 7338
Joined: Tue Mar 20, 2018 5:34 am

Re: Ignore warning on duplicate on duplicate definition

Post by Lech Kulikowski »

Hello,

You can set the Calculation mode option to the Interpretation for the report.
But in that case, any other compilation errors will be ignored.

Thank you.
Post Reply