InfoPath forms and SQL Server Reporting Services


Hi,

I recently worked on a report project having InfoPath form in SharePoint’s InfoPath library as it’s Data Source.

For understanding purpose let’s start with a very simple InfoPath form having two text boxes in it named txtFirstName and txtLastName.

Form

Let’s first define a Data Source for our report.

Name:- InfoPathDataSource

Type:- XML

Connection String : (Suppose the url for our InfoPath library is following

http://nrana-1710-vm1:2575/Sample/Forms/AllItems.aspx and the name of the InfoPath form is PersonalInfo.

So in this case our connection string would be

http://nrana-1710-vm1:2575/Sample/PersonalInfo.xml

Now let’s create a new DataSet having InfoPathDataSource as its data source.

Name :- InfoPathDataSet

Data source :- InfoPathDataSource

Command Type :- Text

Query String :-  ( For defining query string we need to first open up the PersonalInfo.xml file. Paste the following url in IE http://nrana-1710-vm1:2575/Sample/PersonalInfo.xml and download and open the xml file.

Suppose this is the content of the PersonalInfo.xml file

<?xml version="1.0" encoding="utf-8"?>
<?mso-infoPathSolution
name="urn:schemas-microsoft-com:office:infopath:Sample:-myXSD-2010-05-26T09-16-03"
solutionVersion="1.0.0.10"
productVersion="12.0.0.0"
PIVersion="1.0.0.0"
href="
http://nrana-1710-vm1:2575/Sample/Forms/template.xsn"?>
<?mso-application
progid="InfoPath.Document"
versionProgid="InfoPath.Document.2"?>

<my:myFields xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2010-05-26T09:16:03" xml:lang="en-US">
    <my:txtFirstName>Nishant </my:txtFirstName>
    <my:txtLastName>Rana</my:txtLastName>
</my:myFields>

The  Query String to retrieve First and Last name value would be

<Query xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2010-05-26T09:16:03"
xmlns:xd="http://schemas.microsoft.com/office/infopath/2003" xml:lang="en-us">
    <ElementPath>
        my:myFields           
    {
        my:txtFirstName(String),
        my:txtLastName(String)       
    }
    </ElementPath>
</Query>

We also define a parameter in our data set to which we would pass the url to the infopath form i.e.

http://nrana-1710-vm1:2575/Sample/PersonalInfo.xml

That’s it, now if we run the query we can get values for first name and last name.

In case if your InfoPath xml form is looks like this

<my:myFields xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2010-05-12T05:10:51" xml:lang="en-US">
    <my:group1>
        <my:group2>
            <my:field1>2</my:field1>
            <my:field2>nishu</my:field2>………….

Than the Element Path of Query String would be like

<ElementPath>
        my:myFields/my:group1/my:group2          
    {
        my:field1(String),
        my:field2(String)       
    }
    </ElementPath>

Bye…


Discover more from Nishant Rana's Weblog

Subscribe to get the latest posts sent to your email.

Unknown's avatar

Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

5 thoughts on “InfoPath forms and SQL Server Reporting Services”

  1. Hi, i’m thinking about using InfoPath forms in a leave management system for submitting applications, my only concerin is whether i would be able to generate reports out of these infopath forms stored in a Sharepoint forms library, is there a viable solution for implementing reporting on InfoPath forms stored in sharepoint. The information you wrote is very useful as a start up but how extensible is this approach for reporting??

    Like

  2. dear NISHANT ,
    In my case I’m retrieving and infopath’s xml that stored in DB , via web service , in my web service i use data reader to store in List, when I consume this service the following xml structure appears:




    Tareq
    27

    …………………..
    how this query could be applied here !!

    thanks

    Like

  3. I have the following errore with Reporting Services 2008 and Sharepoint 2010:
    DTD is prohibited in this XML document.

    Some ideas??

    Like

Please share your thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Nishant Rana's Weblog

Subscribe now to keep reading and get access to the full archive.

Continue reading

Power Platform Puzzles

D365 CRM, Power Platform Tips &Tricks

Power Spark

Power Spark By Shrangarika

Van Carl Nguyen

Exploration of Power Platform

My Trial

It is my experience timeline.

Power⚡Thomas

Sharing my knowledge and experience about the Microsoft Power Platform.

Arpit Power Guide

a guide to powering up community

Welcome to the Blog of Paul Andrew

Sponsored by Cloud Formations Ltd

Deriving Dynamics 365

Deriving Solutions and features on Power Platform/Dynamics 365

The CRM Ninja

Thoughts & musings from a Microsoft Business Applications Ninja!

D CRM Explorer

Learn about Microsoft Dynamics CRM Power Platform customization and implementation and other cool stuffs

Stroke // Jonas Rapp

I know pre-stroke. I will improve who I was.

Power Melange

Power Melange By Shalinee

Clavin's Blog - PPUG.ORG

AI - Power Automate - Power Apps - SharePoint Online - Azure - Nintex - K2 - Artificial Intelligence

Sat Sangha Salon

An Inquiry in Being

The Indoencers

The Influencers & Influences of Indian Music

Monika Halan's blog

Hand's-free money management

D365 Demystified

A closer look at Microsoft Dynamics 365.

Microsoft Mate (msftmate) - Andrew Rogers

Experienced consultant primarily focused on Microsoft Dynamics 365 and the Power Platform

Manmit Rahevar's Blog

One Stop Destination for Microsoft Technology Solutions

MG

Naturally Curious

Brian Illand

Power Platform and Dynamics 365

Steve Mordue

The Professional Paraphraser

Subwoofer 101

Bass defines your home theater

SQLTwins by Nakul Vachhrajani

SQL Server tips and experiences dedicated to my twin daughters.

Everything D365

Discovering Azure DevOps and D365 Business Applications

Tech Wizard

Lets do IT Spells

XRM Tricks (Power Platform & Dynamics CRM )

Power Platform & Dynamics CRM

CRM TIPS BY PRM

Mail to crmtipsbyprm@gmail.com for queries and suggestions

nijos.dev

Giving back to the community what I have learned

Power Platform Learning

Your Go-To Resource for Power Apps, Power Automate & More

xrm CRM Dynamics

Dynamics CRM Technical & Functional Info

Dynamics 365 Blogs - Explained in unique way

Sometimes you need to look at things from different perspective.