Click here to Skip to main content
15,890,670 members
Home / Discussions / C#
   

C#

 
AnswerRe: Pointer help Pin
Mark Salsbery29-Aug-08 14:03
Mark Salsbery29-Aug-08 14:03 
AnswerRe: Pointer help Pin
Guffa30-Aug-08 0:08
Guffa30-Aug-08 0:08 
QuestionCuror Pin
netJP12L29-Aug-08 9:12
netJP12L29-Aug-08 9:12 
AnswerRe: Curor Pin
Wendelius29-Aug-08 9:38
mentorWendelius29-Aug-08 9:38 
QuestionGet list of all fields referenced from RDLC XML file Pin
AndrusM29-Aug-08 9:05
AndrusM29-Aug-08 9:05 
AnswerRe: Get list of all fields referenced from RDLC XML file Pin
Wendelius29-Aug-08 9:17
mentorWendelius29-Aug-08 9:17 
GeneralRe: Get list of all fields referenced from RDLC XML file Pin
AndrusM29-Aug-08 9:31
AndrusM29-Aug-08 9:31 
GeneralRe: Get list of all fields referenced from RDLC XML file Pin
Wendelius29-Aug-08 9:59
mentorWendelius29-Aug-08 9:59 
This should get you going.
string xmlText = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Report Name=\"WorldFacts\">  <Description>Worlds Facts - test data from MySQL World database</Description>  <DataElementStyle>ElementNormal</DataElementStyle>  <LeftMargin>.4in</LeftMargin>  <RightMargin>.4in</RightMargin>  <TopMargin>.5in</TopMargin>  <BottomMargin>.5in</BottomMargin>  <DataSources>    <DataSource Name=\"DS1\">      <ConnectionProperties>        <DataProvider>xxx</DataProvider>        <!-- Use this line when using xml data -->        <ConnectString>dsn=world;UID=uuu;PWD=ppp;</ConnectString>      </ConnectionProperties>    </DataSource>  </DataSources>  <DataSets>    <DataSet Name=\"Data\">      <Query>        <DataSourceName>DS1</DataSourceName>        <!--   <CommandText>SELECT Code, Name, Continent, Region, Population, IndepYear, SurfaceArea FROM Country</CommandText> -->      </Query>      <Fields>        <Field Name=\"Code\">          <DataField>Code</DataField>          <TypeName>String</TypeName>        </Field>        <Field Name=\"Name\">          <DataField>Name</DataField>          <TypeName>String</TypeName>        </Field>        <Field Name=\"Continent\">          <DataField>Continent</DataField>          <TypeName>String</TypeName>        </Field>        <Field Name=\"Region\">          <DataField>Region</DataField>          <TypeName>String</TypeName>        </Field>        <Field Name=\"Population\">          <DataField>Population</DataField>          <TypeName>Float</TypeName>        </Field>        <Field Name=\"IndependenceYear\">          <DataField>IndependenceYear</DataField>          <TypeName>Float</TypeName>        </Field>        <Field Name=\"SurfaceArea\">          <DataField>SurfaceArea</DataField>          <TypeName>Float</TypeName>        </Field>      </Fields>      <Rows File=\"WorldFacts.xml\" />    </DataSet>  </DataSets>  <PageHeader>    <Height>.5 in</Height>    <ReportItems>      <Textbox Name=\"Textbox1\">        <Top>.1 in</Top>        <Left>.1 in</Left>        <Height>.25 in</Height>        <Value>The World's Countries</Value>        <Style>          <FontSize>15pt</FontSize>          <FontWeight>Bold</FontWeight>        </Style>      </Textbox>    </ReportItems>    <PrintOnFirstPage>True</PrintOnFirstPage>    <PrintOnLastPage>True</PrintOnLastPage>  </PageHeader>  <Body>    <Height>64.4pt</Height>    <ReportItems>      <Table Name=\"Table1\">        <DetailDataElementName>Row</DetailDataElementName>        <DetailDataCollectionName>Rows</DetailDataCollectionName>        <Style>          <BorderStyle>            <Default>Solid</Default>          </BorderStyle>        </Style>        <TableColumns>          <TableColumn>            <Width>.75 in</Width>          </TableColumn>          <TableColumn>            <Width>.5 in</Width>          </TableColumn>          <TableColumn>            <Width>2.5 in</Width>          </TableColumn>          <TableColumn>            <Width>1 in</Width>          </TableColumn>          <TableColumn>            <Width>1 in</Width>          </TableColumn>          <TableColumn>            <Width>1 in</Width>          </TableColumn>          <TableColumn>            <Width>1 in</Width>          </TableColumn>        </TableColumns>        <Header>          <TableRows>            <TableRow>              <Height>12 pt</Height>              <TableCells>                <TableCell>                  <ReportItems>                    <Textbox Name=\"Textbox2\">                      <Value>Continent</Value>                      <Style>                        <PaddingLeft>2 pt</PaddingLeft>                        <BorderStyle>                          <Default>Solid</Default>                        </BorderStyle>                        <FontWeight>Bold</FontWeight>                      </Style>                    </Textbox>                  </ReportItems>                </TableCell>                <TableCell>                  <ReportItems>                    <Textbox Name=\"Textbox3\">                      <Value>Code</Value>                      <Style>                        <PaddingLeft>2 pt</PaddingLeft>                        <BorderStyle>                          <Default>Solid</Default>                        </BorderStyle>                        <FontWeight>Bold</FontWeight>                      </Style>                    </Textbox>                  </ReportItems>                </TableCell>                <TableCell>                  <ReportItems>                    <Textbox Name=\"Textbox4\">                      <Value>Name</Value>                      <Style>                        <PaddingLeft>2 pt</PaddingLeft>                        <BorderStyle>                          <Default>Solid</Default>                        </BorderStyle>                        <FontWeight>Bold</FontWeight>                      </Style>                    </Textbox>                  </ReportItems>                </TableCell>                <TableCell>                  <ReportItems>                    <Textbox Name=\"Textbox5\">                      <Value>Region</Value>                      <Style>                        <PaddingLeft>2 pt</PaddingLeft>                        <BorderStyle>                          <Default>Solid</Default>                        </BorderStyle>                        <FontWeight>Bold</FontWeight>                      </Style>                    </Textbox>                  </ReportItems>                </TableCell>                <TableCell>                  <ReportItems>                    <Textbox Name=\"Textbox6\">                      <Value>Population</Value>                      <Style>                        <PaddingLeft>2 pt</PaddingLeft>                        <BorderStyle>                          <Default>Solid</Default>                        </BorderStyle>                        <FontWeight>Bold</FontWeight>                      </Style>                    </Textbox>                  </ReportItems>                </TableCell>                <TableCell>                  <ReportItems>                    <Textbox Name=\"Textbox7\">                      <Value>Independence</Value>                      <Style>                        <PaddingLeft>2 pt</PaddingLeft>                        <BorderStyle>                          <Default>Solid</Default>                        </BorderStyle>                        <FontWeight>Bold</FontWeight>                      </Style>                    </Textbox>                  </ReportItems>                </TableCell>                <TableCell>                  <ReportItems>                    <Textbox Name=\"Textbox8\">                      <Value>Surface Area</Value>                      <Style>                        <PaddingLeft>2 pt</PaddingLeft>                        <BorderStyle>                          <Default>Solid</Default>                        </BorderStyle>                        <FontWeight>Bold</FontWeight>                      </Style>                    </Textbox>                  </ReportItems>                </TableCell>              </TableCells>            </TableRow>          </TableRows>          <RepeatOnNewPage>true</RepeatOnNewPage>        </Header>        <TableGroups>          <TableGroup>            <Header>              <TableRows>                <TableRow>                  <Height>12 pt</Height>                  <TableCells>                    <TableCell>                      <ColSpan>7</ColSpan>                      <ReportItems>                        <Textbox Name=\"Textbox9\">                          <Value>=Fields.Continent.Value</Value>                          <Style>                            <PaddingLeft>2 pt</PaddingLeft>                            <BorderStyle>                              <Default>Solid</Default>                            </BorderStyle>                            <FontWeight>Bold</FontWeight>                          </Style>                        </Textbox>                      </ReportItems>                    </TableCell>                  </TableCells>                </TableRow>              </TableRows>              <RepeatOnNewPage>true</RepeatOnNewPage>            </Header>            <Footer>              <TableRows>                <TableRow>                  <Height>12 pt</Height>                  <TableCells>                    <TableCell>                      <ColSpan>7</ColSpan>                      <ReportItems>                        <Textbox Name=\"Textbox14\">                          <Value>=\"Count of countries in \" + Fields.Continent.Value + \" = \" +Count(Fields.Name.Value)</Value>                          <Style>                            <PaddingLeft>2 pt</PaddingLeft>                            <BorderStyle>                              <Default>Solid</Default>                            </BorderStyle>                            <FontWeight>Bold</FontWeight>                          </Style>                        </Textbox>                      </ReportItems>                    </TableCell>                  </TableCells>                </TableRow>              </TableRows>            </Footer>            <Grouping Name=\"ContinentGroup\">              <GroupExpressions>                <GroupExpression>=Fields!Continent.Value</GroupExpression>              </GroupExpressions>            </Grouping>          </TableGroup>        </TableGroups>        <Details>          <Sorting>            <SortBy>              <SortExpression>=Fields!Name.Value</SortExpression>            </SortBy>          </Sorting>          <TableRows>            <TableRow>              <Height>12 pt</Height>              <TableCells>                <TableCell>                  <ReportItems>                    <Textbox Name=\"Textbox10\">                      <Value>                      </Value>                      <Style>                        <PaddingLeft>2 pt</PaddingLeft>                        <BorderStyle>                          <Default>Solid</Default>                          <Bottom>None</Bottom>                          <Top>None</Top>                        </BorderStyle>                      </Style>                    </Textbox>                  </ReportItems>                </TableCell>                <TableCell>                  <ReportItems>                    <Textbox Name=\"Code\">                      <Value>=Fields!Code.Value</Value>                      <Style>                        <PaddingLeft>2 pt</PaddingLeft>                        <BorderStyle>                          <Default>Solid</Default>                        </BorderStyle>                      </Style>                    </Textbox>                  </ReportItems>                </TableCell>                <TableCell>                  <ReportItems>                    <Textbox Name=\"Name\">                      <CanGrow>true</CanGrow>                      <Value>=Fields!Name.Value</Value>                      <Style>                        <PaddingLeft>2 pt</PaddingLeft>                        <BorderStyle>                          <Default>Solid</Default>                        </BorderStyle>                      </Style>                    </Textbox>                  </ReportItems>                </TableCell>                <TableCell>                  <ReportItems>                    <Textbox Name=\"Region\">                      <CanGrow>true</CanGrow>                      <Value>=Fields!Region.Value</Value>                      <Style>                        <PaddingLeft>2 pt</PaddingLeft>                        <BorderStyle>                          <Default>Solid</Default>                        </BorderStyle>                      </Style>                    </Textbox>                  </ReportItems>                </TableCell>                <TableCell>                  <ReportItems>                    <Textbox Name=\"Textbox11\">                      <Value>=Fields!Population.Value</Value>                      <Style>                        <Format>#,##0</Format>                        <TextAlign>Right</TextAlign>                        <PaddingRight>2 pt</PaddingRight>                        <BorderStyle>                          <Default>Solid</Default>                        </BorderStyle>                      </Style>                    </Textbox>                  </ReportItems>                </TableCell>                <TableCell>                  <ReportItems>                    <Textbox Name=\"Textbox12\">                      <Value>=switch(Fields!IndependenceYear.Value = 0, \"\", Fields!IndependenceYear.Value &gt; 0, Fields!IndependenceYear.Value, true, -Fields!IndependenceYear.Value + \" BC\")</Value>                      <Style>                        <Format>0000</Format>                        <TextAlign>Center</TextAlign>                        <BorderStyle>                          <Default>Solid</Default>                        </BorderStyle>                      </Style>                    </Textbox>                  </ReportItems>                </TableCell>                <TableCell>                  <ReportItems>                    <Textbox Name=\"Textbox13\">                      <Value>=Fields!SurfaceArea.Value</Value>                      <Style>                        <Format>#,##0</Format>                        <TextAlign>Right</TextAlign>                        <PaddingRight>2 pt</PaddingRight>                        <BorderStyle>                          <Default>Solid</Default>                        </BorderStyle>                      </Style>                    </Textbox>                  </ReportItems>                </TableCell>              </TableCells>            </TableRow>          </TableRows>        </Details>        <Footer>          <TableRows>            <TableRow>              <Height>12 pt</Height>              <TableCells>                <TableCell>                  <ColSpan>4</ColSpan>                  <ReportItems>                    <Textbox Name=\"Textbox15\">                      <Value>=CountDistinct(Fields.Continent.Value) + \" continents.  \" + Count(Fields.Name.Value)+ \" countries.\" </Value>                      <Style>                        <PaddingLeft>2 pt</PaddingLeft>                        <BorderStyle>                          <Default>Solid</Default>                        </BorderStyle>                        <FontWeight>Bold</FontWeight>                      </Style>                    </Textbox>                  </ReportItems>                </TableCell>                <TableCell>                  <ColSpan>1</ColSpan>                  <ReportItems>                    <Textbox Name=\"Textbox16\">                      <Value>=Sum(Fields.Population.Value)</Value>                      <Style>                        <Format>#,##0</Format>                        <TextAlign>Right</TextAlign>                        <PaddingRight>2 pt</PaddingRight>                        <BorderStyle>                          <Default>Solid</Default>                        </BorderStyle>                        <FontWeight>Bold</FontWeight>                      </Style>                    </Textbox>                  </ReportItems>                </TableCell>                <TableCell>                  <ColSpan>1</ColSpan>                  <ReportItems>                    <Textbox Name=\"Textbox17\">                      <Value>                      </Value>                      <Style>                        <Format>#,##0</Format>                        <TextAlign>Right</TextAlign>                        <PaddingRight>2 pt</PaddingRight>                        <BorderStyle>                          <Default>Solid</Default>                        </BorderStyle>                        <FontWeight>Bold</FontWeight>                      </Style>                    </Textbox>                  </ReportItems>                </TableCell>                <TableCell>                  <ColSpan>1</ColSpan>                  <ReportItems>                    <Textbox Name=\"Textbox18\">                      <Value>=Sum(Fields.SurfaceArea.Value)</Value>                      <Style>                        <Format>#,##0</Format>                        <TextAlign>Right</TextAlign>                        <PaddingRight>2 pt</PaddingRight>                        <BorderStyle>                          <Default>Solid</Default>                        </BorderStyle>                        <FontWeight>Bold</FontWeight>                      </Style>                    </Textbox>                  </ReportItems>                </TableCell>              </TableCells>            </TableRow>          </TableRows>        </Footer>      </Table>    </ReportItems>    <Columns>1</Columns>  </Body>  <PageFooter>    <Height>0pt</Height>    <PrintOnFirstPage>True</PrintOnFirstPage>    <PrintOnLastPage>True</PrintOnLastPage>  </PageFooter>  <Width>7in</Width>  <PageWidth>8.5in</PageWidth>  <PageHeight>11in</PageHeight>  <DataElementName>Report</DataElementName></Report>";
         System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
         System.Xml.XmlNodeList selectedNodes;

         xmlDoc.LoadXml(xmlText);

         selectedNodes = xmlDoc.SelectNodes("Report/DataSets/DataSet/Fields/Field");
         foreach (System.Xml.XmlNode xmlNode in selectedNodes) {
            System.Windows.Forms.MessageBox.Show(xmlNode.Attributes["Name"].Value);
         }

GeneralRe: Get list of all fields referenced from RDLC XML file Pin
AndrusM30-Aug-08 6:59
AndrusM30-Aug-08 6:59 
GeneralRe: Get list of all fields referenced from RDLC XML file Pin
Wendelius30-Aug-08 7:10
mentorWendelius30-Aug-08 7:10 
QuestionVenue booking code in vb.net Pin
masosha29-Aug-08 8:35
masosha29-Aug-08 8:35 
AnswerRe: Venue booking code in vb.net Pin
Pete O'Hanlon29-Aug-08 8:38
mvePete O'Hanlon29-Aug-08 8:38 
GeneralRe: Venue booking code in vb.net Pin
Ashfield29-Aug-08 9:02
Ashfield29-Aug-08 9:02 
AnswerRe: Venue booking code in vb.net Pin
Expert Coming29-Aug-08 9:09
Expert Coming29-Aug-08 9:09 
GeneralRe: Venue booking code in vb.net Pin
Verghese29-Aug-08 10:12
Verghese29-Aug-08 10:12 
GeneralRe: Venue booking code in vb.net Pin
Expert Coming29-Aug-08 10:32
Expert Coming29-Aug-08 10:32 
AnswerRe: Venue booking code in vb.net Pin
Wendelius29-Aug-08 10:31
mentorWendelius29-Aug-08 10:31 
QuestionCast Question Pin
Kevin Marois29-Aug-08 8:06
professionalKevin Marois29-Aug-08 8:06 
AnswerRe: Cast Question Pin
DaveyM6929-Aug-08 8:15
professionalDaveyM6929-Aug-08 8:15 
GeneralRe: Cast Question Pin
Kevin Marois29-Aug-08 8:30
professionalKevin Marois29-Aug-08 8:30 
AnswerRe: Cast Question Pin
Expert Coming29-Aug-08 8:21
Expert Coming29-Aug-08 8:21 
GeneralRe: Cast Question Pin
Kevin Marois29-Aug-08 8:28
professionalKevin Marois29-Aug-08 8:28 
GeneralRe: Cast Question Pin
Expert Coming29-Aug-08 8:34
Expert Coming29-Aug-08 8:34 
GeneralRe: Cast Question Pin
Kevin Marois29-Aug-08 8:43
professionalKevin Marois29-Aug-08 8:43 
GeneralRe: Cast Question Pin
Expert Coming29-Aug-08 8:59
Expert Coming29-Aug-08 8:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.