Izenda Logo


This code sample will allow you to place your own export buttons wherever you need them on your report viewer. This button uses our built-in PDF icon and is set to export to pdf. However, you can change but the "src" and "&output=pdf" properties to match whatever image and export type you wish to use, respectively.

<img src="rs.aspx?image=pdf.gif" onclick="window.location='<%=string.Format("{0}?

C♯ Sample

This code sample will allow you to use the Izenda API to generate custom export capabilities with a standard webforms page.

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Izenda.AdHoc;
using Izenda.AdHoc.Database;

public partial class Export : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)
        foreach(string ds in AdHocContext.Driver.DatabaseSchema.Tables.AllKeys)

    protected void DSButton_Click(object sender, EventArgs e)
        foreach (Column column in AdHocContext.Driver.DatabaseSchema.Tables
            ListItem li = new ListItem();
            li.Text = column.Name;
            li.Value = column.SqlName;
            li.Selected = true;

    protected void ExportButton_Click(object sender, EventArgs e)
        ReportSet rs = new ReportSet();

        JoinedTable jt = new JoinedTable();
        jt.TableName = DataSourcesDD.SelectedItem.Value;

        foreach (ListItem li in FieldCBL.Items)
            if (!li.Selected) continue;

            Field f = new Field(li.Value);
        AdHocContext.CurrentReportSet = rs;
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Default.master" CodeFile="Export.aspx.cs" Inherits="Export" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadPlaceHolder" runat="Server">
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolder" runat="Server">
  <div class="page">
    <form id="form1" runat="server">
        <asp:DropDownList ID="DataSourcesDD" runat="server">
        <asp:Button ID="DSButton" runat="server" Text="OK" OnClick="DSButton_Click" />
        <asp:CheckBoxList ID="FieldCBL" runat="server" RepeatColumns="5">
    <asp:Button ID="ExportButton" runat="server" Text="Export" OnClick="ExportButton_Click" />

<asp:Content ID="Content3" ContentPlaceHolderID="TrackerPlaceHolder" runat="Server">