cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
optimusprime Regular Visitor
Regular Visitor

Need an working example of custom visual source code

So I have been trying to get this custom visual working following

https://docs.microsoft.com/en-us/power-bi/developer/custom-visual-develop-tutorial

 

However, except that very first example of "Update Count:0", not a single example code works.  Was this tutorail outdated?  Is there any working example of custom visual available at all?

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
dm-p Established Member
Established Member

Re: Need an working example of custom visual source code

The tutorial is outdated and the methods to generate everything are a little different in the new tooling. I posted this in another thread yesterday which may help out in terms of understanding changes between versions and finding some valid v3 source code, but there really needs to be a newer tutorial produced to help newcomers avoid these kinds of issues going forward.

If you want to specifically work with the version in the tutorial you posted, there's a step under the Installing Packages heading that states the following to install the tools:

npm i -g powerbi-visuals-tools

Try this instead:

npm i -g powerbi-visuals-tools@2.5

After that, run:

pbiviz --version

This should show 2.5.0.

Then, run this in the root of your project:

pbiviz update 2.5.0

This will allow your code to compile, if everything looks as per the tutorial. If not, then you can repeat the steps from Creating and installing a certificate (if changing toolset version you need to generate a new certificate, otherwise the developer visual won't connect) and then creating a new visual project as normal.

Note that you will still need to contend with migration to the v3 tooling, but if you just want to explore the custom visuals framework and TypeScript platform to see how things work and learn the basics then this should get you moving.

Good luck!

Daniel

Note that 

5 REPLIES 5
dm-p Established Member
Established Member

Re: Need an working example of custom visual source code

The tutorial is outdated and the methods to generate everything are a little different in the new tooling. I posted this in another thread yesterday which may help out in terms of understanding changes between versions and finding some valid v3 source code, but there really needs to be a newer tutorial produced to help newcomers avoid these kinds of issues going forward.

If you want to specifically work with the version in the tutorial you posted, there's a step under the Installing Packages heading that states the following to install the tools:

npm i -g powerbi-visuals-tools

Try this instead:

npm i -g powerbi-visuals-tools@2.5

After that, run:

pbiviz --version

This should show 2.5.0.

Then, run this in the root of your project:

pbiviz update 2.5.0

This will allow your code to compile, if everything looks as per the tutorial. If not, then you can repeat the steps from Creating and installing a certificate (if changing toolset version you need to generate a new certificate, otherwise the developer visual won't connect) and then creating a new visual project as normal.

Note that you will still need to contend with migration to the v3 tooling, but if you just want to explore the custom visuals framework and TypeScript platform to see how things work and learn the basics then this should get you moving.

Good luck!

Daniel

Note that 

optimusprime Regular Visitor
Regular Visitor

Re: Need an working example of custom visual source code

@dm-p 

Thanks for clearing things up.

I wonder for people like me with entry level of TS, should we just go back to pbiviz 2.5 and figure out thing in those outdated tutorials and then migrate to 3.0, would that be a good way to go?

 

dm-p Established Member
Established Member

Re: Need an working example of custom visual source code

Hi @optimusprime,

I think that if you want to make use of the majority of existing materials out there then I would say yes, for now. If you are learning TS then it will be fine, and doing any migration work will add to that knowledge (if a little inconvenient). Not sure if it will help, but I did a similar tutorial a while back for a conference and this may provide some further inroads into TS and the framework. It uses the older version of the tooling but instructions have been updated to specify version and I have tested that everything still works.

Cheers,

Daniel

optimusprime Regular Visitor
Regular Visitor

Re: Need an working example of custom visual source code

@dm-p  First of all, thank you for your help.

I went through the PDF you did for the conference (through the link you provided).  I'd hope there are some details for the "tag" on the pdf slides.  I wonder if you have some detailed tutorial in explanations....thanks again.

dm-p Established Member
Established Member

Re: Need an working example of custom visual source code

Hi @optimusprime - glad to help how I can. 

Tags are explained in the 5th slide. You can either check them out locally to see the code at that point in the presentation, or explore the repo in GitHub and view the changes between tags. Easiest way to do this, would be:

  • Click on Code
  • Click on Releases
  • Find the tag that you want to check and click on the commit ref underneath it to have GitHub show you the changes from the last one, e.g.:
    JlkHhtQ

In terms of detail, everything was explained more during the presentation and would take quite a while to write up fully into an article or guide, and I'm very short on free time at the moment! Smiley Happy

I'm hoping that this repo, in conjunction with the latest reference doc that is available will at least help close some of the gaps that I had when starting out.

Good luck,

Daniel

Helpful resources

Announcements
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 435 members 4,200 guests
Please welcome our newest community members: