Senin, 11 Januari 2021

Pertemuan 16 REPORTING

 

Pertemuan 16 REPORTING

·         Langkah pertama buat tampilan pada datagrid menjadi gambar seperti berikut

·         Selanjutnya jika sudah masukkan codingn pada report seperti berikut

<?xml version="1.0" encoding="utf-8"?>

<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">

  <Body>

    <ReportItems>

      <Tablix Name="Tablix1">

        <TablixBody>

          <TablixColumns>

            <TablixColumn>

              <Width>3.302cm</Width>

            </TablixColumn>

            <TablixColumn>

              <Width>3.302cm</Width>

            </TablixColumn>

            <TablixColumn>

              <Width>3.302cm</Width>

            </TablixColumn>

            <TablixColumn>

              <Width>3.302cm</Width>

            </TablixColumn>

            <TablixColumn>

              <Width>3.302cm</Width>

            </TablixColumn>

          </TablixColumns>

          <TablixRows>

            <TablixRow>

              <Height>0.6cm</Height>

              <TablixCells>

                <TablixCell>

                  <CellContents>

                    <Textbox Name="Textbox2">

                      <CanGrow>true</CanGrow>

                      <KeepTogether>true</KeepTogether>

                      <Paragraphs>

                        <Paragraph>

                          <TextRuns>

                            <TextRun>

                              <Value>id buku</Value>

                              <Style>

                                <FontFamily>Tahoma</FontFamily>

                                <FontSize>11pt</FontSize>

                                <FontWeight>Bold</FontWeight>

                                <Color>White</Color>

                              </Style>

                            </TextRun>

                          </TextRuns>

                          <Style />

                        </Paragraph>

                      </Paragraphs>

                      <rd:DefaultName>Textbox2</rd:DefaultName>

                      <Style>

                        <Border>

                          <Color>#7292cc</Color>

                          <Style>Solid</Style>

                        </Border>

                        <BackgroundColor>#4c68a2</BackgroundColor>

                        <PaddingLeft>2pt</PaddingLeft>

                        <PaddingRight>2pt</PaddingRight>

                        <PaddingTop>2pt</PaddingTop>

                        <PaddingBottom>2pt</PaddingBottom>

                      </Style>

                    </Textbox>

                  </CellContents>

                </TablixCell>

                <TablixCell>

                  <CellContents>

                    <Textbox Name="Textbox3">

                      <CanGrow>true</CanGrow>

                      <KeepTogether>true</KeepTogether>

                      <Paragraphs>

                        <Paragraph>

                          <TextRuns>

                            <TextRun>

                              <Value>judul</Value>

                              <Style>

                                <FontFamily>Tahoma</FontFamily>

                                <FontSize>11pt</FontSize>

                                <FontWeight>Bold</FontWeight>

                                <Color>White</Color>

                              </Style>

                            </TextRun>

                          </TextRuns>

                          <Style />

                        </Paragraph>

                      </Paragraphs>

                      <rd:DefaultName>Textbox3</rd:DefaultName>

                      <Style>

                        <Border>

                          <Color>#7292cc</Color>

                          <Style>Solid</Style>

                        </Border>

                        <BackgroundColor>#4c68a2</BackgroundColor>

                        <PaddingLeft>2pt</PaddingLeft>

                        <PaddingRight>2pt</PaddingRight>

                        <PaddingTop>2pt</PaddingTop>

                        <PaddingBottom>2pt</PaddingBottom>

                      </Style>

                    </Textbox>

                  </CellContents>

                </TablixCell>

                <TablixCell>

                  <CellContents>

                    <Textbox Name="Textbox5">

                      <CanGrow>true</CanGrow>

                      <KeepTogether>true</KeepTogether>

                      <Paragraphs>

                        <Paragraph>

                          <TextRuns>

                            <TextRun>

                              <Value>isbn</Value>

                              <Style>

                                <FontFamily>Tahoma</FontFamily>

                                <FontSize>11pt</FontSize>

                                <FontWeight>Bold</FontWeight>

                                <Color>White</Color>

                              </Style>

                            </TextRun>

                          </TextRuns>

                          <Style />

                        </Paragraph>

                      </Paragraphs>

                      <rd:DefaultName>Textbox5</rd:DefaultName>

                      <Style>

                        <Border>

                          <Color>#7292cc</Color>

                          <Style>Solid</Style>

                        </Border>

                        <BackgroundColor>#4c68a2</BackgroundColor>

                        <PaddingLeft>2pt</PaddingLeft>

                        <PaddingRight>2pt</PaddingRight>

                        <PaddingTop>2pt</PaddingTop>

                        <PaddingBottom>2pt</PaddingBottom>

                      </Style>

                    </Textbox>

                  </CellContents>

                </TablixCell>

                <TablixCell>

                  <CellContents>

                    <Textbox Name="Textbox7">

                      <CanGrow>true</CanGrow>

                      <KeepTogether>true</KeepTogether>

                      <Paragraphs>

                        <Paragraph>

                          <TextRuns>

                            <TextRun>

                              <Value>penerbit</Value>

                              <Style>

                                <FontFamily>Tahoma</FontFamily>

                                <FontSize>11pt</FontSize>

                                <FontWeight>Bold</FontWeight>

                                <Color>White</Color>

                              </Style>

                            </TextRun>

                          </TextRuns>

                          <Style />

                        </Paragraph>

                      </Paragraphs>

                      <rd:DefaultName>Textbox7</rd:DefaultName>

                      <Style>

                        <Border>

                          <Color>#7292cc</Color>

                          <Style>Solid</Style>

                        </Border>

                        <BackgroundColor>#4c68a2</BackgroundColor>

                        <PaddingLeft>2pt</PaddingLeft>

                        <PaddingRight>2pt</PaddingRight>

                        <PaddingTop>2pt</PaddingTop>

                        <PaddingBottom>2pt</PaddingBottom>

                      </Style>

                    </Textbox>

                  </CellContents>

                </TablixCell>

                <TablixCell>

                  <CellContents>

                    <Textbox Name="Textbox9">

                      <CanGrow>true</CanGrow>

                      <KeepTogether>true</KeepTogether>

                      <Paragraphs>

                        <Paragraph>

                          <TextRuns>

                            <TextRun>

                              <Value>penulis</Value>

                              <Style>

                                <FontFamily>Tahoma</FontFamily>

                                <FontSize>11pt</FontSize>

                                <FontWeight>Bold</FontWeight>

                                <Color>White</Color>

                              </Style>

                            </TextRun>

                          </TextRuns>

                          <Style />

                        </Paragraph>

                      </Paragraphs>

                      <rd:DefaultName>Textbox9</rd:DefaultName>

                      <Style>

                        <Border>

                          <Color>#7292cc</Color>

                          <Style>Solid</Style>

                        </Border>

                        <BackgroundColor>#4c68a2</BackgroundColor>

                        <PaddingLeft>2pt</PaddingLeft>

                        <PaddingRight>2pt</PaddingRight>

                        <PaddingTop>2pt</PaddingTop>

                        <PaddingBottom>2pt</PaddingBottom>

                      </Style>

                    </Textbox>

                  </CellContents>

                </TablixCell>

              </TablixCells>

            </TablixRow>

            <TablixRow>

              <Height>0.6cm</Height>

              <TablixCells>

                <TablixCell>

                  <CellContents>

                    <Textbox Name="id_buku">

                      <CanGrow>true</CanGrow>

                      <KeepTogether>true</KeepTogether>

                      <Paragraphs>

                        <Paragraph>

                          <TextRuns>

                            <TextRun>

                              <Value>=Sum(Fields!id_buku.Value)</Value>

                              <Style>

                                <FontFamily>Tahoma</FontFamily>

                                <Color>#4d4d4d</Color>

                              </Style>

                            </TextRun>

                          </TextRuns>

                          <Style />

                        </Paragraph>

                      </Paragraphs>

                      <rd:DefaultName>id_buku</rd:DefaultName>

                      <Style>

                        <Border>

                          <Color>#e5e5e5</Color>

                          <Style>Solid</Style>

                        </Border>

                        <PaddingLeft>2pt</PaddingLeft>

                        <PaddingRight>2pt</PaddingRight>

                        <PaddingTop>2pt</PaddingTop>

                        <PaddingBottom>2pt</PaddingBottom>

                      </Style>

                    </Textbox>

                  </CellContents>

                </TablixCell>

                <TablixCell>

                  <CellContents>

                    <Textbox Name="judul">

                      <CanGrow>true</CanGrow>

                      <KeepTogether>true</KeepTogether>

                      <Paragraphs>

                        <Paragraph>

                          <TextRuns>

                            <TextRun>

                              <Value>=Fields!judul.Value</Value>

                              <Style>

                                <FontFamily>Tahoma</FontFamily>

                                <Color>#4d4d4d</Color>

                              </Style>

                            </TextRun>

                          </TextRuns>

                          <Style />

                        </Paragraph>

                      </Paragraphs>

                      <rd:DefaultName>judul</rd:DefaultName>

                      <Style>

                        <Border>

                          <Color>#e5e5e5</Color>

                          <Style>Solid</Style>

                        </Border>

                        <PaddingLeft>2pt</PaddingLeft>

                        <PaddingRight>2pt</PaddingRight>

                        <PaddingTop>2pt</PaddingTop>

                        <PaddingBottom>2pt</PaddingBottom>

                      </Style>

                    </Textbox>

                  </CellContents>

                </TablixCell>

                <TablixCell>

                  <CellContents>

                    <Textbox Name="isbn">

                      <CanGrow>true</CanGrow>

                      <KeepTogether>true</KeepTogether>

                      <Paragraphs>

                        <Paragraph>

                          <TextRuns>

                            <TextRun>

                              <Value>=Fields!isbn.Value</Value>

                              <Style>

                                <FontFamily>Tahoma</FontFamily>

                                <Color>#4d4d4d</Color>

                              </Style>

                            </TextRun>

                          </TextRuns>

                          <Style />

                        </Paragraph>

                      </Paragraphs>

                      <rd:DefaultName>isbn</rd:DefaultName>

                      <Style>

                        <Border>

                          <Color>#e5e5e5</Color>

                          <Style>Solid</Style>

                        </Border>

                        <PaddingLeft>2pt</PaddingLeft>

                        <PaddingRight>2pt</PaddingRight>

                        <PaddingTop>2pt</PaddingTop>

                        <PaddingBottom>2pt</PaddingBottom>

                      </Style>

                    </Textbox>

                  </CellContents>

                </TablixCell>

                <TablixCell>

                  <CellContents>

                    <Textbox Name="penerbit">

                      <CanGrow>true</CanGrow>

                      <KeepTogether>true</KeepTogether>

                      <Paragraphs>

                        <Paragraph>

                          <TextRuns>

                            <TextRun>

                              <Value>=Fields!penerbit.Value</Value>

                              <Style>

                                <FontFamily>Tahoma</FontFamily>

                                <Color>#4d4d4d</Color>

                              </Style>

                            </TextRun>

                          </TextRuns>

                          <Style />

                        </Paragraph>

                      </Paragraphs>

                      <rd:DefaultName>penerbit</rd:DefaultName>

                      <Style>

                        <Border>

                          <Color>#e5e5e5</Color>

                          <Style>Solid</Style>

                        </Border>

                        <PaddingLeft>2pt</PaddingLeft>

                        <PaddingRight>2pt</PaddingRight>

                        <PaddingTop>2pt</PaddingTop>

                        <PaddingBottom>2pt</PaddingBottom>

                      </Style>

                    </Textbox>

                  </CellContents>

                </TablixCell>

                <TablixCell>

                  <CellContents>

                    <Textbox Name="penulis">

                      <CanGrow>true</CanGrow>

                      <KeepTogether>true</KeepTogether>

                      <Paragraphs>

                        <Paragraph>

                          <TextRuns>

                            <TextRun>

                              <Value>=Fields!penulis.Value</Value>

                              <Style>

                                <FontFamily>Tahoma</FontFamily>

                                <Color>#4d4d4d</Color>

                              </Style>

                            </TextRun>

                          </TextRuns>

                          <Style />

                        </Paragraph>

                      </Paragraphs>

                      <rd:DefaultName>penulis</rd:DefaultName>

                      <Style>

                        <Border>

                          <Color>#e5e5e5</Color>

                          <Style>Solid</Style>

                        </Border>

                        <PaddingLeft>2pt</PaddingLeft>

                        <PaddingRight>2pt</PaddingRight>

                        <PaddingTop>2pt</PaddingTop>

                        <PaddingBottom>2pt</PaddingBottom>

                      </Style>

                    </Textbox>

                  </CellContents>

                </TablixCell>

              </TablixCells>

            </TablixRow>

          </TablixRows>

        </TablixBody>

        <TablixColumnHierarchy>

          <TablixMembers>

            <TablixMember />

            <TablixMember />

            <TablixMember />

            <TablixMember />

            <TablixMember />

          </TablixMembers>

        </TablixColumnHierarchy>

        <TablixRowHierarchy>

          <TablixMembers>

            <TablixMember>

              <KeepWithGroup>After</KeepWithGroup>

            </TablixMember>

            <TablixMember>

              <Group Name="Details" />

            </TablixMember>

          </TablixMembers>

        </TablixRowHierarchy>

        <DataSetName>datasetbukuhendrik</DataSetName>

        <Height>1.2cm</Height>

        <Width>16.51cm</Width>

        <Style>

          <Border>

            <Style>None</Style>

          </Border>

        </Style>

      </Tablix>

    </ReportItems>

    <Height>2in</Height>

    <Style />

  </Body>

  <Width>6.5in</Width>

  <Page>

    <PageHeader>

      <Height>2.54cm</Height>

      <PrintOnFirstPage>true</PrintOnFirstPage>

      <PrintOnLastPage>true</PrintOnLastPage>

      <ReportItems>

        <Textbox Name="Textbox11">

          <CanGrow>true</CanGrow>

          <KeepTogether>true</KeepTogether>

          <Paragraphs>

            <Paragraph>

              <TextRuns>

                <TextRun>

                  <Value>LAPORAN BUKU</Value>

                  <Style>

                    <FontStyle>Normal</FontStyle>

                    <FontSize>30pt</FontSize>

                    <FontWeight>Bold</FontWeight>

                    <TextDecoration>Underline</TextDecoration>

                    <Color>Blue</Color>

                  </Style>

                </TextRun>

              </TextRuns>

              <Style />

            </Paragraph>

          </Paragraphs>

          <rd:DefaultName>Textbox11</rd:DefaultName>

          <Top>0.36724cm</Top>

          <Height>1.68479cm</Height>

          <Width>15.99375cm</Width>

          <Style>

            <Border>

              <Style>None</Style>

            </Border>

            <PaddingLeft>2pt</PaddingLeft>

            <PaddingRight>2pt</PaddingRight>

            <PaddingTop>2pt</PaddingTop>

            <PaddingBottom>2pt</PaddingBottom>

          </Style>

        </Textbox>

      </ReportItems>

      <Style>

        <Border>

          <Style>None</Style>

        </Border>

      </Style>

    </PageHeader>

    <PageHeight>29.7cm</PageHeight>

    <PageWidth>21cm</PageWidth>

    <LeftMargin>2cm</LeftMargin>

    <RightMargin>2cm</RightMargin>

    <TopMargin>2cm</TopMargin>

    <BottomMargin>2cm</BottomMargin>

    <ColumnSpacing>0.13cm</ColumnSpacing>

    <Style />

  </Page>

  <AutoRefresh>0</AutoRefresh>

  <DataSources>

    <DataSource Name="DataSetbukuhendrik">

      <ConnectionProperties>

        <DataProvider>System.Data.DataSet</DataProvider>

        <ConnectString>/* Local Connection */</ConnectString>

      </ConnectionProperties>

      <rd:DataSourceID>bd0895c1-0c77-49be-bf18-595187112f16</rd:DataSourceID>

    </DataSource>

  </DataSources>

  <DataSets>

    <DataSet Name="datasetbukuhendrik">

      <Query>

        <DataSourceName>DataSetbukuhendrik</DataSourceName>

        <CommandText>/* Local Query */</CommandText>

      </Query>

      <Fields>

        <Field Name="id_buku">

          <DataField>id_buku</DataField>

          <rd:TypeName>System.Int32</rd:TypeName>

        </Field>

        <Field Name="id_kategori">

          <DataField>id_kategori</DataField>

          <rd:TypeName>System.Int32</rd:TypeName>

        </Field>

        <Field Name="judul">

          <DataField>judul</DataField>

          <rd:TypeName>System.String</rd:TypeName>

        </Field>

        <Field Name="isbn">

          <DataField>isbn</DataField>

          <rd:TypeName>System.String</rd:TypeName>

        </Field>

        <Field Name="penerbit">

          <DataField>penerbit</DataField>

          <rd:TypeName>System.String</rd:TypeName>

        </Field>

        <Field Name="penulis">

          <DataField>penulis</DataField>

          <rd:TypeName>System.String</rd:TypeName>

        </Field>

      </Fields>

      <rd:DataSetInfo>

        <rd:DataSetName>DataSetbukuhendrik</rd:DataSetName>

        <rd:SchemaPath>D:\Point\Jurusan TI\TUK Belajar DP\UJI Kompetensi DP 21-22 juni 2019 Hendrik S. U\buku_hendrik\buku_hendrik\DataSetbukuhendrik.xsd</rd:SchemaPath>

        <rd:TableName>DataTable</rd:TableName>

        <rd:TableAdapterFillMethod>Fill</rd:TableAdapterFillMethod>

        <rd:TableAdapterGetDataMethod>GetData</rd:TableAdapterGetDataMethod>

        <rd:TableAdapterName>DataTableTableAdapter</rd:TableAdapterName>

      </rd:DataSetInfo>

    </DataSet>

  </DataSets>

  <rd:ReportUnitType>Cm</rd:ReportUnitType>

  <rd:ReportID>479d18c1-c584-4b14-9d35-aad5deeb9d73</rd:ReportID>

</Report>

 

·         Jika selesai selanjutnya tes untuk running jika berhasil akan muncul tampilan seperti berikut