Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use C# syntax in report expressions
Message
De
28/03/2007 11:44:44
 
 
À
28/03/2007 11:23:23
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01208749
Message ID:
01209274
Vues:
10
>>>I use WinForms Microsoft ReportViewer in local mode.
>>>
>>>I want to use C# syntax in report expressions instead on VB syntax.
>>>
>>>How to use C# instead of VB.NET syntax ?
>>>
>>>I'm thinking about the following approaches:
>>>
>>>1. Create pre-processor which converts expressions in RDL file from C# to
>>>VB. NET
>>>
>>>2. Replace all expressions with a method which takes C# expression as string
>>>parameter, evaluates it returns result.
>>>
>>>
>>>Any idea how to implement this ?
>>>
>>>Where to find any samples of C# expression evaluator or C# to VB .NET expression converter ?
>>
>>C has yacc, dialects have either yacc or bison - or both, which is an LARL(1) parser
>>
>>The cleanest way to attack the problem is with yacc/bison imo - suppose .net has something similar
>>
>>Then, you have to define the grammar, and take it from there
>
>Thank you.
>
>I'm thinking about implementing recursive expression parser.
>This is probably simpler than using special tools, is'nt it ?
>I think I can start with simple expression converter and add new functions and operators in needed.
>
>Where to find sample of simple expression parser ?

Why not follow the road Rod and/or YAG indicated ? Seems much, much simpler to me

These looks promising:
- http://msdn2.microsoft.com/en-us/library/bb165037(VS.80).aspx
- http://msdn2.microsoft.com/en-us/library/bb166533(VS.80).aspx

I do not know .Net too much, so I cannot be of any help there

You have to define a grammar first
The grammar would the be transformed into a state machine (compiled or not)
Your expression serves as input to the state machine
The output should be a 'converted' expression

Do not think you can do this in a few days
Gregory
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform